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.

  1. mapWriter :: ((a, w) -> (b, w')) -> Writer w a -> Writer w' b

    mtl Control.Monad.Writer.Lazy

    Map both the return value and output of a computation using the given function.

  2. mapWriterT :: (m (a, w) -> n (b, w')) -> WriterT w m a -> WriterT w' n b

    mtl Control.Monad.Writer.Lazy

    Map both the return value and output of a computation using the given function.

  3. mapWriter :: ((a, w) -> (b, w')) -> Writer w a -> Writer w' b

    mtl Control.Monad.Writer.Strict

    Map both the return value and output of a computation using the given function.

  4. mapWriterT :: (m (a, w) -> n (b, w')) -> WriterT w m a -> WriterT w' n b

    mtl Control.Monad.Writer.Strict

    Map both the return value and output of a computation using the given function.

  5. mapKeyVal :: (Key -> Key) -> (v1 -> v2) -> KeyMap v1 -> KeyMap v2

    aeson Data.Aeson.KeyMap

    Transform the keys and values of a KeyMap.

  6. mapMaybe :: (a -> Maybe b) -> KeyMap a -> KeyMap b

    aeson Data.Aeson.KeyMap

    Map values and collect the Just results.

  7. mapMaybeWithKey :: (Key -> v -> Maybe u) -> KeyMap v -> KeyMap u

    aeson Data.Aeson.KeyMap

    Map values and collect the Just results.

  8. mapWithKey :: (Key -> a -> b) -> KeyMap a -> KeyMap b

    aeson Data.Aeson.KeyMap

    Map a function over all values in the map.

  9. mapFromJSONKeyFunction :: (a -> b) -> FromJSONKeyFunction a -> FromJSONKeyFunction b

    aeson Data.Aeson.Types

    Same as fmap. Provided for the consistency with ToJSONKeyFunction.

  10. mapKeys :: Hashable k2 => (k1 -> k2) -> HashMap k1 v -> HashMap k2 v

    unordered-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")]
    

Page 104 of many | Previous | Next