continuations-0.0.0.0: Continuations, CPS, co-functions, and combinators for working with them
Safe HaskellNone
LanguageHaskell2010

Data.Profunctor.Cofun

Synopsis

Co-functions

data Cofun r b a Source #

Constructors

(:>-) infixr 0 

Fields

Instances

Instances details
Profunctor (Cofun r) Source # 
Instance details

Defined in Data.Profunctor.Cofun

Methods

dimap :: (a -> b) -> (c -> d) -> Cofun r b c -> Cofun r a d

lmap :: (a -> b) -> Cofun r b c -> Cofun r a c

rmap :: (b -> c) -> Cofun r a b -> Cofun r a c

(#.) :: forall a b c q. Coercible c b => q b c -> Cofun r a b -> Cofun r a c

(.#) :: forall a b c q. Coercible b a => Cofun r b c -> q a b -> Cofun r a c

Mixfix syntax

type (>-) a r = Cofun r a infixr 1 Source #

type (-~) r b = r b infixr 0 Source #

Construction

(>-) :: (r ! b) -> a -> (b >- r) -~ a infixr 1 Source #

Elimination

withCofun :: ((b >- r) -~ a) -> s ! ((r ! b) -> s ! a) Source #

elimCofun :: ((b ~~ r) ~> a) -> r ! ((a >- r) -~ b) Source #

runCofun :: (b -> a) -> r ! ((a >- r) -~ b) Source #

Computation

cocurry :: Disj d => (c -> a `d` b) -> (((b >- r) -~ c) ~~ r) ~> a Source #

uncocurry :: Disj d => ((((b >- r) -~ c) ~~ r) ~> a) -> (c ~~ r) ~> (a `d` b) Source #

coap :: Disj d => (c ~~ r) ~> (((b >- r) -~ c) `d` b) Source #