profunctors-5.2: Profunctors

Safe HaskellNone
LanguageHaskell2010

Data.Profunctor.Traversing

Contents

Synopsis

Documentation

class (Choice p, Strong p) => Traversing p where Source #

Note: Definitions in terms of wander are much more efficient!

Minimal complete definition

wander | traverse'

Methods

traverse' :: Traversable f => p a b -> p (f a) (f b) Source #

wander :: (forall f. Applicative f => (a -> f b) -> s -> f t) -> p a b -> p s t Source #

Instances

Traversing (->) Source # 

Methods

traverse' :: Traversable f => (a -> b) -> f a -> f b Source #

wander :: (forall f. Applicative f => (a -> f b) -> s -> f t) -> (a -> b) -> s -> t Source #

Monad m => Traversing (Kleisli m) Source # 

Methods

traverse' :: Traversable f => Kleisli m a b -> Kleisli m (f a) (f b) Source #

wander :: (forall f. Applicative f => (a -> f b) -> s -> f t) -> Kleisli m a b -> Kleisli m s t Source #

Applicative m => Traversing (Star m) Source # 

Methods

traverse' :: Traversable f => Star m a b -> Star m (f a) (f b) Source #

wander :: (forall f. Applicative f => (a -> f b) -> s -> f t) -> Star m a b -> Star m s t Source #

Traversing (FreeTraversing p) Source # 

Methods

traverse' :: Traversable f => FreeTraversing p a b -> FreeTraversing p (f a) (f b) Source #

wander :: (forall f. Applicative f => (a -> f b) -> s -> f t) -> FreeTraversing p a b -> FreeTraversing p s t Source #

Profunctor p => Traversing (CofreeTraversing p) Source # 

Methods

traverse' :: Traversable f => CofreeTraversing p a b -> CofreeTraversing p (f a) (f b) Source #

wander :: (forall f. Applicative f => (a -> f b) -> s -> f t) -> CofreeTraversing p a b -> CofreeTraversing p s t Source #

Traversing (FreeMapping p) Source # 

Methods

traverse' :: Traversable f => FreeMapping p a b -> FreeMapping p (f a) (f b) Source #

wander :: (forall f. Applicative f => (a -> f b) -> s -> f t) -> FreeMapping p a b -> FreeMapping p s t Source #

Profunctor p => Traversing (CofreeMapping p) Source # 

Methods

traverse' :: Traversable f => CofreeMapping p a b -> CofreeMapping p (f a) (f b) Source #

wander :: (forall f. Applicative f => (a -> f b) -> s -> f t) -> CofreeMapping p a b -> CofreeMapping p s t Source #

newtype CofreeTraversing p a b Source #

Constructors

CofreeTraversing 

Fields

Instances

ProfunctorComonad CofreeTraversing Source # 
ProfunctorFunctor CofreeTraversing Source # 
Profunctor p => Profunctor (CofreeTraversing p) Source # 

Methods

dimap :: (a -> b) -> (c -> d) -> CofreeTraversing p b c -> CofreeTraversing p a d Source #

lmap :: (a -> b) -> CofreeTraversing p b c -> CofreeTraversing p a c Source #

rmap :: (b -> c) -> CofreeTraversing p a b -> CofreeTraversing p a c Source #

(#.) :: Coercible * c b => (b -> c) -> CofreeTraversing p a b -> CofreeTraversing p a c Source #

(.#) :: Coercible * b a => CofreeTraversing p b c -> (a -> b) -> CofreeTraversing p a c Source #

Profunctor p => Strong (CofreeTraversing p) Source # 

Methods

first' :: CofreeTraversing p a b -> CofreeTraversing p (a, c) (b, c) Source #

second' :: CofreeTraversing p a b -> CofreeTraversing p (c, a) (c, b) Source #

Profunctor p => Choice (CofreeTraversing p) Source # 
Profunctor p => Traversing (CofreeTraversing p) Source # 

Methods

traverse' :: Traversable f => CofreeTraversing p a b -> CofreeTraversing p (f a) (f b) Source #

wander :: (forall f. Applicative f => (a -> f b) -> s -> f t) -> CofreeTraversing p a b -> CofreeTraversing p s t Source #

data FreeTraversing p a b where Source #

FreeTraversing -| CofreeTraversing

Constructors

FreeTraversing :: Traversable f => (f y -> b) -> p x y -> (a -> f x) -> FreeTraversing p a b 

Instances

ProfunctorMonad FreeTraversing Source # 
ProfunctorFunctor FreeTraversing Source # 
Profunctor (FreeTraversing p) Source # 

Methods

dimap :: (a -> b) -> (c -> d) -> FreeTraversing p b c -> FreeTraversing p a d Source #

lmap :: (a -> b) -> FreeTraversing p b c -> FreeTraversing p a c Source #

rmap :: (b -> c) -> FreeTraversing p a b -> FreeTraversing p a c Source #

(#.) :: Coercible * c b => (b -> c) -> FreeTraversing p a b -> FreeTraversing p a c Source #

(.#) :: Coercible * b a => FreeTraversing p b c -> (a -> b) -> FreeTraversing p a c Source #

Strong (FreeTraversing p) Source # 

Methods

first' :: FreeTraversing p a b -> FreeTraversing p (a, c) (b, c) Source #

second' :: FreeTraversing p a b -> FreeTraversing p (c, a) (c, b) Source #

Choice (FreeTraversing p) Source # 

Methods

left' :: FreeTraversing p a b -> FreeTraversing p (Either a c) (Either b c) Source #

right' :: FreeTraversing p a b -> FreeTraversing p (Either c a) (Either c b) Source #

Traversing (FreeTraversing p) Source # 

Methods

traverse' :: Traversable f => FreeTraversing p a b -> FreeTraversing p (f a) (f b) Source #

wander :: (forall f. Applicative f => (a -> f b) -> s -> f t) -> FreeTraversing p a b -> FreeTraversing p s t Source #

Strong in terms of Traversing

firstTraversing :: Traversing p => p a b -> p (a, c) (b, c) Source #

secondTraversing :: Traversing p => p a b -> p (c, a) (c, b) Source #

Choice in terms of Traversing

leftTraversing :: Traversing p => p a b -> p (Either a c) (Either b c) Source #

rightTraversing :: Traversing p => p a b -> p (Either c a) (Either c b) Source #