mezzolens-0.0.0: Pure Profunctor Functional Lenses

Safe HaskellSafe
LanguageHaskell2010

Mezzolens.Profunctor

Synopsis

Documentation

class Profunctor p where Source

Minimal complete definition

Nothing

Methods

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

imap :: (a -> b) -> p b c -> p a c Source

omap :: (c -> d) -> p a c -> p a d Source

class Profunctor p => Strong p where Source

Minimal complete definition

Nothing

Methods

_1 :: p a b -> p (a, c) (b, c) Source

_2 :: p a b -> p (c, a) (c, b) Source

Instances

class Strong p => OutPhantom p where Source

Methods

ocoerce :: p c a -> p c b Source

Instances

Phantom f => OutPhantom (Kleisli f) Source 
OutPhantom p => OutPhantom (AlongSide p c d) Source 

class Profunctor p => Choice p where Source

Minimal complete definition

Nothing

Methods

_Left :: p a b -> p (Either a c) (Either b c) Source

_Right :: p a b -> p (Either c a) (Either c b) Source

Instances

Choice (->) Source 
Applicative f => Choice (Kleisli f) Source 
Phantom f => Choice (SuperStar f) Source 
Choice p => Choice (EitherSide p c d) Source 

class Choice p => InPhantom p where Source

Methods

icoerce :: p a c -> p b c Source

Instances

Phantom f => InPhantom (SuperStar f) Source 
InPhantom p => InPhantom (EitherSide p c d) Source 

class (Strong p, Choice p) => Wandering p where Source

Methods

wander :: Traversable f => p a b -> p (f a) (f b) Source

class Wandering p => Cartographic p where Source

Methods

map :: Functor f => p a b -> p (f a) (f b) Source

Instances

_2Default :: OutPhantom p => p a b -> p (c, a) (c, b) Source

_RightDefault :: InPhantom p => p a b -> p (Either c a) (Either c b) Source

data ProProduct p q a b Source

Constructors

ProProduct 

Fields

upper :: p a b
 
lower :: q a b
 

Instances

newtype SuperStar f a b Source

Constructors

SuperStar 

Fields

runSuperStar :: f a -> b
 

Instances

Phantom f => InPhantom (SuperStar f) Source 
Phantom f => Choice (SuperStar f) Source 
Functor f => Profunctor (SuperStar f) Source 

newtype Kleisli m a b :: (* -> *) -> * -> * -> *

Kleisli arrows of a monad.

Constructors

Kleisli 

Fields

runKleisli :: a -> m b
 

Instances

Monad m => Category * (Kleisli m) 
Monad m => Arrow (Kleisli m) 
MonadPlus m => ArrowZero (Kleisli m) 
MonadPlus m => ArrowPlus (Kleisli m) 
Monad m => ArrowChoice (Kleisli m) 
Monad m => ArrowApply (Kleisli m) 
MonadFix m => ArrowLoop (Kleisli m)

Beware that for many monads (those for which the >>= operation is strict) this instance will not satisfy the right-tightening law required by the ArrowLoop class.

Applicative f => Wandering (Kleisli f) Source 
Applicative f => Choice (Kleisli f) Source 
Phantom f => OutPhantom (Kleisli f) Source 
Functor f => Strong (Kleisli f) Source 
Functor f => Profunctor (Kleisli f) Source