Hoogle Search
Within LTS Haskell 24.32 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
mapWriter :: ((a, w) -> (b, w')) -> Writer w a -> Writer w' bmtl Control.Monad.Writer.Lazy Map both the return value and output of a computation using the given function.
mapWriterT :: (m (a, w) -> n (b, w')) -> WriterT w m a -> WriterT w' n bmtl Control.Monad.Writer.Lazy Map both the return value and output of a computation using the given function.
runWriterT (mapWriterT f m) = f (runWriterT m)
mapWriter :: ((a, w) -> (b, w')) -> Writer w a -> Writer w' bmtl Control.Monad.Writer.Strict Map both the return value and output of a computation using the given function.
mapWriterT :: (m (a, w) -> n (b, w')) -> WriterT w m a -> WriterT w' n bmtl Control.Monad.Writer.Strict Map both the return value and output of a computation using the given function.
runWriterT (mapWriterT f m) = f (runWriterT m)
mapKeyVal :: (Key -> Key) -> (v1 -> v2) -> KeyMap v1 -> KeyMap v2aeson Data.Aeson.KeyMap Transform the keys and values of a KeyMap.
mapMaybe :: (a -> Maybe b) -> KeyMap a -> KeyMap baeson Data.Aeson.KeyMap Map values and collect the Just results.
mapMaybeWithKey :: (Key -> v -> Maybe u) -> KeyMap v -> KeyMap uaeson Data.Aeson.KeyMap Map values and collect the Just results.
mapWithKey :: (Key -> a -> b) -> KeyMap a -> KeyMap baeson Data.Aeson.KeyMap Map a function over all values in the map.
mapFromJSONKeyFunction :: (a -> b) -> FromJSONKeyFunction a -> FromJSONKeyFunction baeson Data.Aeson.Types Same as fmap. Provided for the consistency with ToJSONKeyFunction.
mapKeys :: Hashable k2 => (k1 -> k2) -> HashMap k1 v -> HashMap k2 vunordered-containers Data.HashMap.Internal mapKeys f s is the map obtained by applying f to each key of s. The size of the result may be smaller if f maps two or more distinct keys to the same new key. In this case there is no guarantee which of the associated values is chosen for the conflicting key.
>>> mapKeys (+ 1) (fromList [(5,"a"), (3,"b")]) fromList [(4,"b"),(6,"a")] >>> mapKeys (\ _ -> 1) (fromList [(1,"b"), (2,"a"), (3,"d"), (4,"c")]) fromList [(1,"c")] >>> mapKeys (\ _ -> 3) (fromList [(1,"b"), (2,"a"), (3,"d"), (4,"c")]) fromList [(3,"c")]