Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type Traversal s t a b = forall (p :: Type -> Type -> Type). IsTraversal p => Optic p s t a b
- type Traversal' s a = Traversal s s a a
- class (IsOptional p, IsTraversal1 p, Traversing p) => IsTraversal (p :: Type -> Type -> Type)
- traversal :: (forall (f :: Type -> Type). Applicative f => (a -> f b) -> s -> f t) -> Traversal s t a b
- traversed :: forall (t :: Type -> Type) a b. Traversable t => Traversal (t a) (t b) a b
- backwards :: Traversal s t a b -> Traversal s t a b
- both :: forall (r :: Type -> Type -> Type) a b. Bitraversable r => Traversal (r a a) (r b b) a b
- beside :: forall (r :: Type -> Type -> Type) s1 t1 a b s2 t2. Bitraversable r => Traversal s1 t1 a b -> Traversal s2 t2 a b -> Traversal (r s1 s2) (r t1 t2) a b
- ignored :: forall s a b p. IsTraversal p => Optic p s s a b
- traverseOf :: Applicative f => Traversal s t a b -> (a -> f b) -> s -> f t
- forOf :: Applicative f => Traversal s t a b -> s -> (a -> f b) -> f t
- sequenceOf :: Applicative f => Traversal s t (f b) b -> s -> f t
- transposeOf :: Traversal s t [a] a -> s -> [t]
- mapAccumLOf :: Traversal s t a b -> (accum -> a -> (b, accum)) -> accum -> s -> (t, accum)
- mapAccumROf :: Traversal s t a b -> (accum -> a -> (b, accum)) -> accum -> s -> (t, accum)
- scanl1Of :: Traversal s t a a -> (a -> a -> a) -> s -> t
- scanr1Of :: Traversal s t a a -> (a -> a -> a) -> s -> t
Traversals
type Traversal s t a b = forall (p :: Type -> Type -> Type). IsTraversal p => Optic p s t a b Source #
type Traversal' s a = Traversal s s a a Source #
class (IsOptional p, IsTraversal1 p, Traversing p) => IsTraversal (p :: Type -> Type -> Type) Source #
Instances
Monad m => IsTraversal (Kleisli m) Source # | |
Defined in Fresnel.Traversal.Internal | |
Monoid r => IsTraversal (Forget r :: Type -> Type -> Type) Source # | |
Defined in Fresnel.Traversal.Internal | |
Applicative f => IsTraversal (Star f) Source # | |
Defined in Fresnel.Traversal.Internal | |
IsTraversal (->) Source # | |
Defined in Fresnel.Traversal.Internal |
Construction
traversal :: (forall (f :: Type -> Type). Applicative f => (a -> f b) -> s -> f t) -> Traversal s t a b Source #
both :: forall (r :: Type -> Type -> Type) a b. Bitraversable r => Traversal (r a a) (r b b) a b Source #
beside :: forall (r :: Type -> Type -> Type) s1 t1 a b s2 t2. Bitraversable r => Traversal s1 t1 a b -> Traversal s2 t2 a b -> Traversal (r s1 s2) (r t1 t2) a b Source #
ignored :: forall s a b p. IsTraversal p => Optic p s s a b Source #
The trivially empty
.Traversal
traverseOf
ignored
f = pure
Elimination
traverseOf :: Applicative f => Traversal s t a b -> (a -> f b) -> s -> f t Source #
Map over the targets of an Iso
, Lens
, Optional
, or Traversal
, collecting the results.
traverseOf
.traversal
=id
traverseOf
traversed
=traverse
forOf :: Applicative f => Traversal s t a b -> s -> (a -> f b) -> f t Source #
sequenceOf :: Applicative f => Traversal s t (f b) b -> s -> f t Source #
transposeOf :: Traversal s t [a] a -> s -> [t] Source #
mapAccumLOf :: Traversal s t a b -> (accum -> a -> (b, accum)) -> accum -> s -> (t, accum) Source #
mapAccumROf :: Traversal s t a b -> (accum -> a -> (b, accum)) -> accum -> s -> (t, accum) Source #