Hoogle Search
Within LTS Haskell 24.68 (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 -> mincipit-base Incipit.Foldable 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"
-
incipit-base Incipit.Libraries A map of integers to values a.
-
No documentation available.
-
liquid-fixpoint Data.ShareMap A HashMap that can share the values of some entries If two keys k1 and k2 are mapped to single v, updating the entry for k1 also updates the entry for k2 and viceversa. The user of the map is responsible for indicating which keys are going to share their values. Keys can be updated with shareMapInsertWith and mergeKeysWith.
toHashMap :: (Hashable k, Eq k) => ShareMap k v -> HashMap k vliquid-fixpoint Data.ShareMap No documentation available.
type
CMap a = HashMap SubcId aliquid-fixpoint Language.Fixpoint.Graph.Types No documentation available.
lookupCMap :: (?callStack :: CallStack) => CMap a -> SubcId -> aliquid-fixpoint Language.Fixpoint.Graph.Types CMap API -------------------------------------------------------------
allMap :: (Eq k, Hashable k) => (v -> Bool) -> HashMap k v -> Boolliquid-fixpoint Language.Fixpoint.Misc No documentation available.
asyncMapM :: (a -> IO b) -> [a] -> IO [b]liquid-fixpoint Language.Fixpoint.Misc No documentation available.
groupMap :: (Eq k, Hashable k) => (a -> k) -> [a] -> HashMap k [a]liquid-fixpoint Language.Fixpoint.Misc No documentation available.