Hoogle Search

Within LTS Haskell 24.33 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. mapM :: (Contiguous arr1, Contiguous arr2, Element arr1 a, Element arr2 b, Monad m) => (a -> m b) -> arr1 a -> m (arr2 b)

    contiguous Data.Primitive.Contiguous

    Map each element of a structure to a monadic action, evaluate these actions from left to right, and collect the results. for a version that ignores the results see mapM_.

  2. mapM_ :: (Contiguous arr, Element arr a, Element arr b, Applicative f) => (a -> f b) -> arr a -> f ()

    contiguous Data.Primitive.Contiguous

    Map each element of a structure to a monadic action, evaluate these actions from left to right, and ignore the results. For a version that doesn't ignore the results see mapM. mapM_ = traverse_

  3. mapMaybe :: forall arr1 arr2 a b . (Contiguous arr1, Element arr1 a, Contiguous arr2, Element arr2 b) => (a -> Maybe b) -> arr1 a -> arr2 b

    contiguous Data.Primitive.Contiguous

    The mapMaybe function is a version of map which can throw out elements. In particular, the functional arguments returns something of type Maybe b. If this is Nothing, no element is added on to the result array. If it is Just b, then b is included in the result array.

  4. mapMutable :: forall (arr :: Type -> Type) a m . (Contiguous arr, Element arr a, PrimMonad m) => (a -> a) -> Mutable arr (PrimState m) a -> m ()

    contiguous Data.Primitive.Contiguous

    Map over a mutable array, modifying the elements in place.

  5. mapMutable' :: forall m (arr :: Type -> Type) a . (PrimMonad m, Contiguous arr, Element arr a) => (a -> a) -> Mutable arr (PrimState m) a -> m ()

    contiguous Data.Primitive.Contiguous

    Strictly map over a mutable array, modifying the elements in place.

  6. mapOrHead :: (Num a, Eq a) => a -> (t -> b) -> [t] -> ([b] -> b) -> b

    dbus DBus.Generation

    No documentation available.

  7. mapMaybe :: Ord k => (a -> Maybe b) -> Map k a -> Map k b

    dhall Dhall.Map

    Transform all values in a Map using the supplied function, deleting the key if the function returns Nothing

    >>> mapMaybe Data.Maybe.listToMaybe (fromList [("C",[1]),("B",[]),("A",[3])])
    fromList [("C",1),("A",3)]
    

  8. mapWithKey :: (k -> a -> b) -> Map k a -> Map k b

    dhall Dhall.Map

    Transform the values of a Map using their corresponding key

    mapWithKey (pure id) = id
    
    mapWithKey (liftA2 (.) f g) = mapWithKey f . mapWithKey g
    
    mapWithKey f mempty = mempty
    
    mapWithKey f (x <> y) = mapWithKey f x <> mapWithKey f y
    
    >>> mapWithKey (,) (fromList [("B",1),("A",2)])
    fromList [("B",("B",1)),("A",("A",2))]
    

  9. mapMOf :: LensLike (WrappedMonad m) s t a b -> (a -> m b) -> s -> m t

    dhall Dhall.Optics

    Identical to Control.Lens.mapMOf

  10. mapperIsLabelDeriver :: Deriver

    domain Domain

    Generates instances of IsLabel for sums and products, providing mappers over their components.

    Product Example

    Having the following schema:
    NetworkAddress:
    product:
    protocol: TransportProtocol
    host: Host
    port: Word16
    
    The following instances will be generated:
    instance
    mapper ~ (TransportProtocol -> TransportProtocol) =>
    IsLabel "protocol" (mapper -> NetworkAddress -> NetworkAddress)
    where
    fromLabel mapper (NetworkAddress a b c) =
    NetworkAddress (mapper a) b c
    
    instance
    mapper ~ (Host -> Host) =>
    IsLabel "host" (mapper -> NetworkAddress -> NetworkAddress)
    where
    fromLabel mapper (NetworkAddress a b c) =
    NetworkAddress a (mapper b) c
    
    instance
    mapper ~ (Word16 -> Word16) =>
    IsLabel "port" (mapper -> NetworkAddress -> NetworkAddress)
    where
    fromLabel mapper (NetworkAddress a b c) =
    NetworkAddress a b (mapper c)
    
    In case you're wondering what this tilde (~) constraint business is about, refer to the Type Equality Constraint section.

    Sum Example

    Having the following schema:
    Host:
    sum:
    ip: Ip
    name: Text
    
    The following instances will be generated:
    instance
    mapper ~ (Ip -> Ip) =>
    IsLabel "ip" (mapper -> Host -> Host)
    where
    fromLabel fn (IpHost a) = IpHost (fn a)
    fromLabel _ a = a
    
    instance
    mapper ~ (Text -> Text) =>
    IsLabel "name" (mapper -> Host -> Host)
    where
    fromLabel fn (NameHost a) = NameHost (fn a)
    fromLabel _ a = a
    
    In case you're wondering what this tilde (~) constraint business is about, refer to the Type Equality Constraint section.

Page 193 of many | Previous | Next