Hoogle Search
Within LTS Haskell 24.45 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
foldMap' :: (Foldable t, Monoid m) => (a -> m) -> t a -> mrebase Rebase.Prelude A left-associative variant of foldMap that is strict in the accumulator. Use this method for strict reduction when partial results are merged via (<>).
Examples
Define a Monoid over finite bit strings under xor. Use it to strictly compute the xor of a list of Int values.>>> :set -XGeneralizedNewtypeDeriving >>> import Data.Bits (Bits, FiniteBits, xor, zeroBits) >>> import Data.Foldable (foldMap') >>> import Numeric (showHex) >>> >>> newtype X a = X a deriving (Eq, Bounded, Enum, Bits, FiniteBits) >>> instance Bits a => Semigroup (X a) where X a <> X b = X (a `xor` b) >>> instance Bits a => Monoid (X a) where mempty = X zeroBits >>> >>> let bits :: [Int]; bits = [0xcafe, 0xfeed, 0xdeaf, 0xbeef, 0x5411] >>> (\ (X a) -> showString "0x" . showHex a $ "") $ foldMap' X bits "0x42"
fmapArgDescr :: (a -> b) -> ArgDescr a -> ArgDescr bshell-utility Shell.Utility.GetOpt No documentation available.
fmapOptDescr :: (a -> b) -> OptDescr a -> OptDescr bshell-utility Shell.Utility.GetOpt No documentation available.
-
skylighting Skylighting.Syntax Default mapping from short names to syntax definitions.
-
sqlite-simple Database.SQLite.Simple No documentation available.
-
sqlite-simple Database.SQLite.Simple No documentation available.
peekMap :: (Store (ContainerKey t), Store (MapValue t), IsMap t) => Peek tstore Data.Store.Internal Implement peek for an IsMap of where both ContainerKey and MapValue are Store instances.
-
store Data.Store.Internal Decode the results of pokeOrdMap using a given function to construct the map.
pokeMap :: (Store (ContainerKey t), Store (MapValue t), IsMap t) => t -> Poke ()store Data.Store.Internal Implement poke for an IsMap of where both ContainerKey and MapValue are Store instances.
pokeOrdMap :: (Store (ContainerKey t), Store (MapValue t), IsMap t) => t -> Poke ()store Data.Store.Internal Like pokeMap but should only be used for ordered containers where mapToList returns an ascending list.