Hoogle Search

Within LTS Haskell 24.41 (ghc-9.10.3)

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

  1. concatMapOf :: Getting [r] s a -> (a -> [r]) -> s -> [r]

    lens Control.Lens.Combinators

    Map a function over all the targets of a Fold of a container and concatenate the resulting lists.

    >>> concatMapOf both (\x -> [x, x + 1]) (1,3)
    [1,2,3,4]
    
    concatMapconcatMapOf folded
    
    concatMapOf :: Getter s a     -> (a -> [r]) -> s -> [r]
    concatMapOf :: Fold s a       -> (a -> [r]) -> s -> [r]
    concatMapOf :: Lens' s a      -> (a -> [r]) -> s -> [r]
    concatMapOf :: Iso' s a       -> (a -> [r]) -> s -> [r]
    concatMapOf :: Traversal' s a -> (a -> [r]) -> s -> [r]
    

  2. contramap :: Contravariant f => (a' -> a) -> f a -> f a'

    lens Control.Lens.Combinators

    No documentation available.

  3. contramapped :: forall (f :: Type -> Type) b a . Contravariant f => Setter (f b) (f a) a b

    lens Control.Lens.Combinators

    This Setter can be used to map over all of the inputs to a Contravariant.

    contramapover contramapped
    
    >>> getPredicate (over contramapped (*2) (Predicate even)) 5
    True
    
    >>> getOp (over contramapped (*5) (Op show)) 100
    "500"
    
    >>> Prelude.map ($ 1) $ over (mapped . _Unwrapping' Op . contramapped) (*12) [(*2),(+1),(^3)]
    [24,13,1728]
    

  4. contramapping :: forall (f :: Type -> Type) s t a b . Contravariant f => AnIso s t a b -> Iso (f a) (f b) (f s) (f t)

    lens Control.Lens.Combinators

    Lift an Iso into a Contravariant functor.

    contramapping :: Contravariant f => Iso s t a b -> Iso (f a) (f b) (f s) (f t)
    contramapping :: Contravariant f => Iso' s a -> Iso' (f a) (f s)
    

  5. dimap :: Profunctor p => (a -> b) -> (c -> d) -> p b c -> p a d

    lens Control.Lens.Combinators

    Map over both arguments at the same time.

    dimap f g ≡ lmap f . rmap g
    

  6. dimapping :: forall (p :: Type -> Type -> Type) (q :: Type -> Type -> Type) s t a b s' t' a' b' . (Profunctor p, Profunctor q) => AnIso s t a b -> AnIso s' t' a' b' -> Iso (p a s') (q b t') (p s a') (q t b')

    lens Control.Lens.Combinators

    Lift two Isos into both arguments of a Profunctor simultaneously.

    dimapping :: Profunctor p => Iso s t a b -> Iso s' t' a' b' -> Iso (p a s') (p b t') (p s a') (p t b')
    dimapping :: Profunctor p => Iso' s a -> Iso' s' a' -> Iso' (p a s') (p s a')
    

  7. foldMapBy :: Foldable t => (r -> r -> r) -> r -> (a -> r) -> t a -> r

    lens Control.Lens.Combinators

    Fold a value using its Foldable instance using explicitly provided Monoid operations. This is like foldMap where the Monoid instance can be manually specified.

    foldMapBy mappend memptyfoldMap
    
    >>> foldMapBy (+) 0 length ["hello","world"]
    10
    

  8. foldMapByOf :: Fold s a -> (r -> r -> r) -> r -> (a -> r) -> s -> r

    lens Control.Lens.Combinators

    Fold a value using a specified Fold and Monoid operations. This is like foldMapBy where the Foldable instance can be manually specified.

    foldMapByOf foldedfoldMapBy
    
    foldMapByOf :: Getter s a     -> (r -> r -> r) -> r -> (a -> r) -> s -> r
    foldMapByOf :: Fold s a       -> (r -> r -> r) -> r -> (a -> r) -> s -> r
    foldMapByOf :: Traversal' s a -> (r -> r -> r) -> r -> (a -> r) -> s -> r
    foldMapByOf :: Lens' s a      -> (r -> r -> r) -> r -> (a -> r) -> s -> r
    foldMapByOf :: Iso' s a       -> (r -> r -> r) -> r -> (a -> r) -> s -> r
    
    >>> foldMapByOf both (+) 0 length ("hello","world")
    10
    

  9. foldMapOf :: Getting r s a -> (a -> r) -> s -> r

    lens Control.Lens.Combinators

    Map each part of a structure viewed through a Lens, Getter, Fold or Traversal to a monoid and combine the results.

    >>> foldMapOf (folded . both . _Just) Sum [(Just 21, Just 21)]
    Sum {getSum = 42}
    
    foldMap = foldMapOf folded
    
    foldMapOfviews
    ifoldMapOf l = foldMapOf l . Indexed
    
    foldMapOf ::                Getter s a      -> (a -> r) -> s -> r
    foldMapOf :: Monoid r    => Fold s a        -> (a -> r) -> s -> r
    foldMapOf :: Semigroup r => Fold1 s a       -> (a -> r) -> s -> r
    foldMapOf ::                Lens' s a       -> (a -> r) -> s -> r
    foldMapOf ::                Iso' s a        -> (a -> r) -> s -> r
    foldMapOf :: Monoid r    => Traversal' s a  -> (a -> r) -> s -> r
    foldMapOf :: Semigroup r => Traversal1' s a -> (a -> r) -> s -> r
    foldMapOf :: Monoid r    => Prism' s a      -> (a -> r) -> s -> r
    
    foldMapOf :: Getting r s a -> (a -> r) -> s -> r
    

  10. iconcatMap :: FoldableWithIndex i f => (i -> a -> [b]) -> f a -> [b]

    lens Control.Lens.Combinators

    Concatenate the results of a function of the elements of an indexed container with access to the index. When you don't need access to the index then concatMap is more flexible in what it accepts.

    concatMapiconcatMap . const
    iconcatMapifoldMap
    

Page 417 of many | Previous | Next