Hoogle Search

Within LTS Haskell 24.51 (ghc-9.10.3)

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

  1. biconcatMap :: Bifoldable t => (a -> [c]) -> (b -> [c]) -> t a b -> [c]

    base Data.Bifoldable

    Given a means of mapping the elements of a structure to lists, computes the concatenation of all such lists in order.

    Examples

    Basic usage:
    >>> biconcatMap (take 3) (fmap digitToInt) ([1..], "89")
    [1,2,3,8,9]
    
    >>> biconcatMap (take 3) (fmap digitToInt) (Left [1..])
    [1,2,3]
    
    >>> biconcatMap (take 3) (fmap digitToInt) (Right "89")
    [8,9]
    

  2. bifoldMap :: (Bifoldable p, Monoid m) => (a -> m) -> (b -> m) -> p a b -> m

    base Data.Bifoldable

    Combines the elements of a structure, given ways of mapping them to a common monoid.

    bifoldMap f g ≡ bifoldr (mappend . f) (mappend . g) mempty
    

    Examples

    Basic usage:
    >>> bifoldMap (take 3) (fmap digitToInt) ([1..], "89")
    [1,2,3,8,9]
    
    >>> bifoldMap (take 3) (fmap digitToInt) (Left [1..])
    [1,2,3]
    
    >>> bifoldMap (take 3) (fmap digitToInt) (Right "89")
    [8,9]
    

  3. bimapM_ :: (Bifoldable t, Applicative f) => (a -> f c) -> (b -> f d) -> t a b -> f ()

    base Data.Bifoldable

    Alias for bitraverse_.

  4. bifoldMap1 :: (Bifoldable1 t, Semigroup m) => (a -> m) -> (b -> m) -> t a b -> m

    base Data.Bifoldable1

    No documentation available.

  5. bimap :: Bifunctor p => (a -> b) -> (c -> d) -> p a c -> p b d

    base Data.Bifunctor

    Map over both arguments at the same time.

    bimap f g ≡ first f . second g
    

    Examples

    >>> bimap toUpper (+1) ('j', 3)
    ('J',4)
    
    >>> bimap toUpper (+1) (Left 'j')
    Left 'J'
    
    >>> bimap toUpper (+1) (Right 3)
    Right 4
    

  6. bifoldMapDefault :: (Bitraversable t, Monoid m) => (a -> m) -> (b -> m) -> t a b -> m

    base Data.Bitraversable

    A default definition of bifoldMap in terms of the Bitraversable operations.

    bifoldMapDefault f g ≡
    getConst . bitraverse (Const . f) (Const . g)
    

  7. bimapAccumL :: Bitraversable t => (a -> b -> (a, c)) -> (a -> d -> (a, e)) -> a -> t b d -> (a, t c e)

    base Data.Bitraversable

    The bimapAccumL function behaves like a combination of bimap and bifoldl; it traverses a structure from left to right, threading a state of type a and using the given actions to compute new elements for the structure.

    Examples

    Basic usage:
    >>> bimapAccumL (\acc bool -> (acc + 1, show bool)) (\acc string -> (acc * 2, reverse string)) 3 (True, "foo")
    (8,("True","oof"))
    

  8. bimapAccumR :: Bitraversable t => (a -> b -> (a, c)) -> (a -> d -> (a, e)) -> a -> t b d -> (a, t c e)

    base Data.Bitraversable

    The bimapAccumR function behaves like a combination of bimap and bifoldr; it traverses a structure from right to left, threading a state of type a and using the given actions to compute new elements for the structure.

    Examples

    Basic usage:
    >>> bimapAccumR (\acc bool -> (acc + 1, show bool)) (\acc string -> (acc * 2, reverse string)) 3 (True, "foo")
    (7,("True","oof"))
    

  9. bimapDefault :: Bitraversable t => (a -> b) -> (c -> d) -> t a c -> t b d

    base Data.Bitraversable

    A default definition of bimap in terms of the Bitraversable operations.

    bimapDefault f g ≡
    runIdentity . bitraverse (Identity . f) (Identity . g)
    

  10. bimapM :: (Bitraversable t, Applicative f) => (a -> f c) -> (b -> f d) -> t a b -> f (t c d)

    base Data.Bitraversable

    Alias for bitraverse.

Page 399 of many | Previous | Next