Hoogle Search
Within LTS Haskell 24.52 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
ofoldMap1 :: (MonoFoldable mono, Semigroup m) => (Element mono -> m) -> NonNull mono -> mmono-traversable Data.NonNull Map each element of a monomorphic container to a semigroup, and combine the results. Safe version of ofoldMap1Ex, only works on monomorphic containers wrapped in a NonNull.
Examples
> let xs = ncons ("hello", 1 :: Integer) [(" world", 2)] > ofoldMap1 fst xs "hello world"conversionMap :: (Ok a -> Ok b) -> Conversion a -> Conversion bpostgresql-simple Database.PostgreSQL.Simple.FromField No documentation available.
-
postgresql-simple Database.PostgreSQL.Simple.HStore No documentation available.
HStoreMap :: Map Text Text -> HStoreMappostgresql-simple Database.PostgreSQL.Simple.HStore No documentation available.
fromHStoreMap :: HStoreMap -> Map Text Textpostgresql-simple Database.PostgreSQL.Simple.HStore No documentation available.
conversionMap :: (Ok a -> Ok b) -> Conversion a -> Conversion bpostgresql-simple Database.PostgreSQL.Simple.Internal No documentation available.
-
autodocodec Autodocodec Map a codec in both directions. This is not strictly dimap, because the decoding function is allowed to fail, but we can implement dimap using this function by using a decoding function that does not fail. Otherwise we would have to have another constructor here.
-
autodocodec Autodocodec -
autodocodec Autodocodec Map a codec's input and output types. This function allows you to have the parsing fail in a new way. If you use this function, then you will most likely want to add documentation about how not every value that the schema specifies will be accepted. This function is like BimapCodec except it also combines one level of a nested BimapCodecs.
Example usage
logLevelCodec :: JSONCodec LogLevel logLevelCodec = bimapCodec parseLogLevel renderLogLevel codec ? "Valid values include DEBUG, INFO, WARNING, ERROR." -
autodocodec Autodocodec Map both directions of a codec You can use this function to change the type of a codec as long as the two functions are inverses.
HasCodec instance for newtypes
A good use-case is implementing HasCodec for newtypes:newtype MyInt = MyInt { unMyInt :: Int } instance HasCodec MyInt where codec = dimapCodec MyInt unMyInt codec