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. lmapping :: forall (p :: Type -> Type -> Type) (q :: Type -> Type -> Type) s t a b x y . (Profunctor p, Profunctor q) => AnIso s t a b -> Iso (p a x) (q b y) (p s x) (q t y)

    lens Control.Lens.Iso

    Lift an Iso contravariantly into the left argument of a Profunctor.

    lmapping :: Profunctor p => Iso s t a b -> Iso (p a x) (p b y) (p s x) (p t y)
    lmapping :: Profunctor p => Iso' s a -> Iso' (p a x) (p s x)
    

  2. rmap :: Profunctor p => (b -> c) -> p a b -> p a c

    lens Control.Lens.Iso

    Map the second argument covariantly.

    rmapdimap id
    

  3. rmapping :: forall (p :: Type -> Type -> Type) (q :: Type -> Type -> Type) s t a b x y . (Profunctor p, Profunctor q) => AnIso s t a b -> Iso (p x s) (q y t) (p x a) (q y b)

    lens Control.Lens.Iso

    Lift an Iso covariantly into the right argument of a Profunctor.

    rmapping :: Profunctor p => Iso s t a b -> Iso (p x s) (p y t) (p x a) (p y b)
    rmapping :: Profunctor p => Iso' s a -> Iso' (p x s) (p x a)
    

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

    lens Control.Lens.Review

    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
    

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

    lens Control.Lens.Setter

    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]
    

  6. imapOf :: AnIndexedSetter i s t a b -> (i -> a -> b) -> s -> t

    lens Control.Lens.Setter

    Deprecated: Use iover

  7. imapAccumLOf :: Over (Indexed i) (State acc) s t a b -> (i -> acc -> a -> (acc, b)) -> acc -> s -> (acc, t)

    lens Control.Lens.Traversal

    Generalizes mapAccumL to an arbitrary IndexedTraversal with access to the index. imapAccumLOf accumulates state from left to right.

    mapAccumLOf l ≡ imapAccumLOf l . const
    
    imapAccumLOf :: IndexedLens i s t a b      -> (i -> acc -> a -> (acc, b)) -> acc -> s -> (acc, t)
    imapAccumLOf :: IndexedTraversal i s t a b -> (i -> acc -> a -> (acc, b)) -> acc -> s -> (acc, t)
    

  8. imapAccumROf :: Over (Indexed i) (Backwards (State acc)) s t a b -> (i -> acc -> a -> (acc, b)) -> acc -> s -> (acc, t)

    lens Control.Lens.Traversal

    Generalizes mapAccumR to an arbitrary IndexedTraversal with access to the index. imapAccumROf accumulates state from right to left.

    mapAccumROf l ≡ imapAccumROf l . const
    
    imapAccumROf :: IndexedLens i s t a b      -> (i -> acc -> a -> (acc, b)) -> acc -> s -> (acc, t)
    imapAccumROf :: IndexedTraversal i s t a b -> (i -> acc -> a -> (acc, b)) -> acc -> s -> (acc, t)
    

  9. imapMOf :: Over (Indexed i) (WrappedMonad m) s t a b -> (i -> a -> m b) -> s -> m t

    lens Control.Lens.Traversal

    Map each element of a structure targeted by a Lens to a monadic action, evaluate these actions from left to right, and collect the results, with access its position. When you don't need access to the index mapMOf is more liberal in what it can accept.

    mapMOf l ≡ imapMOf l . const
    
    imapMOf :: Monad m => IndexedLens       i s t a b -> (i -> a -> m b) -> s -> m t
    imapMOf :: Monad m => IndexedTraversal  i s t a b -> (i -> a -> m b) -> s -> m t
    imapMOf :: Bind  m => IndexedTraversal1 i s t a b -> (i -> a -> m b) -> s -> m t
    

  10. ixmapped :: forall (a :: Type -> Type -> Type) e i j . (IArray a e, Ix i, Ix j) => (i, i) -> IndexPreservingSetter (a j e) (a i e) i j

    lens Data.Array.Lens

    This Setter can be used to derive a new IArray from an old IArray by applying a function to each of the indices to look it up in the old IArray. This is a contravariant Setter.

    ixmapover . ixmapped
    ixmappedsetting . ixmap
    over (ixmapped b) f arr ! i ≡ arr ! f i
    bounds (over (ixmapped b) f arr) ≡ b
    

Page 423 of many | Previous | Next