Hoogle Search
Within LTS Haskell 24.28 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
awaitJust :: forall (m :: Type -> Type) src i . (Monad m, HasError m) => String -> ParserT m src i ihpp Hpp.Parser await that throws an error with the given message if no more input is available. This may be used to locate where in a processing pipeline input was unexpectedly exhausted.
-
hpp Hpp.StringSig No documentation available.
predicateJust :: (a -> Bool) -> a -> Maybe ahpp Hpp.StringSig No documentation available.
-
hyperbole Web.Hyperbole No documentation available.
-
hyperbole Web.Hyperbole.View No documentation available.
-
invertible Data.Invertible.Maybe Convert between Just and its value.
-
invertible Data.Invertible.Maybe adjust :: Ord k => (v -> v) -> Key ph k -> Map ph k v -> Map ph k vjustified-containers Data.Map.Justified Adjust the valid at a key, known to be in the map, using the given function. Since the set of valid keys in the input map and output map are the same, keys that were valid for the input map remain valid for the output map.
adjustWithKey :: Ord k => (Key ph k -> v -> v) -> Key ph k -> Map ph k v -> Map ph k vjustified-containers Data.Map.Justified Adjust the valid at a key, known to be in the map, using the given function. Since the set of valid keys in the input map and output map are the same, keys that were valid for the input map remain valid for the output map.
adjustingOutputHeaders :: (Header -> Header) -> Iso' (Csv' Name) (Csv' Name)lens-csv Data.Csv.Lens Allows rewritingaddingremoving headers on the CSV both before serializing Note that rewriting a header name DOES NOT affect any of the records, it only affects the choice and order of the columns in the output CSV. If you want to rename a column header you must also rename the name of that field on all rows in the csv. This is a limitation of cassava itself. Examples: Drop the first column:
>>> BL.lines (myCsv & namedCsv . adjustingOutputHeaders (view _tail) %~ id) ["population\r","19540000\r","39560000\r"]
Add a new column with the population in millions>>> import Data.Char (toLower) >>> addStateLower m = M.insert "state_lower" (m ^. ix "state_code" . to (map toLower)) m >>> :{ BL.lines (myCsv & namedCsv -- Add "state_lower" to output headers so it will be serialized . adjustingOutputHeaders (<> pure "state_lower") . rows . _NamedRecord @(M.Map String String) -- Add "state_lower" to each record %~ addStateLower ) :} ["state_code,population,state_lower\r","NY,19540000,ny\r","CA,39560000,ca\r"]Reverse column order >>> BL.lines (myCsv & namedCsv . adjustingOutputHeaders (view reversed) %~ id) ["population,state_coder","19540000,NYr","39560000,CAr"]