proton-0.0.4
Safe HaskellNone
LanguageHaskell2010

Proton.Loop

Documentation

type Loop s t a b = forall p. Cochoice p => p a b -> p s t Source #

type Loop' s a = Loop s s a a Source #

data CoPrism a b s t Source #

Constructors

CoPrism (s -> a) (b -> Either a t) 

Instances

Instances details
Profunctor (CoPrism a b) Source # 
Instance details

Defined in Proton.Loop

Methods

dimap :: (a0 -> b0) -> (c -> d) -> CoPrism a b b0 c -> CoPrism a b a0 d #

lmap :: (a0 -> b0) -> CoPrism a b b0 c -> CoPrism a b a0 c #

rmap :: (b0 -> c) -> CoPrism a b a0 b0 -> CoPrism a b a0 c #

(#.) :: forall a0 b0 c q. Coercible c b0 => q b0 c -> CoPrism a b a0 b0 -> CoPrism a b a0 c #

(.#) :: forall a0 b0 c q. Coercible b0 a0 => CoPrism a b b0 c -> q a0 b0 -> CoPrism a b a0 c #

Cochoice (CoPrism a b) Source # 
Instance details

Defined in Proton.Loop

Methods

unleft :: CoPrism a b (Either a0 d) (Either b0 d) -> CoPrism a b a0 b0 #

unright :: CoPrism a b (Either d a0) (Either d b0) -> CoPrism a b a0 b0 #

loop :: forall p s t a b. Cochoice p => (s -> a) -> (b -> Either a t) -> Optic p s t a b Source #

iterM :: forall s t a. Optic (Star ((,) [a])) s t a a -> (a -> Either a a) -> s -> ([a], t) Source #