0 | module Control.Monad.TransitionIndexed
3 | infixl 1 >>>=
, =<<<
, >>>
10 | interface TransitionIndexedPointed z (0 m : (ty : Type) -> z -> (ty -> z) -> Type) | m where
11 | pure : {0 a : Type} -> {0 f : a -> z} -> (x : a) -> m a (f x) f
27 | interface TransitionIndexedMonad z (0 m : (ty : Type) -> z -> (ty -> z) -> Type) | m where
28 | bind : {0 x : z} -> {0 f : a -> z} -> {0 g : b -> z} -> m a x f -> ((res : a) -> m b (f res) g) -> m b x g
31 | (>>>=) : TransitionIndexedMonad z m => m a x f -> ((res : a) -> m b (f res) g) -> m b x g
36 | (=<<<) : TransitionIndexedMonad z m => {0 a : Type} -> {0 f : a -> z} -> ((res : a) -> m b (f res) g) -> m a x f -> m b x g
37 | (=<<<) = flip (>>>=)
40 | (>>>) : TransitionIndexedMonad z m => m () x f -> Lazy (m b (f ()) g) -> m b x g
41 | (>>>) y w = y >>>= \() => w
45 | when : TransitionIndexedPointed z m => Bool -> Lazy (m () (f ()) f) -> m () (f ()) f
47 | when False w = pure ()
51 | unless : TransitionIndexedPointed z m => Bool -> Lazy (m () (f ()) f) -> m () (f ()) f
57 | traverse_ : (Foldable t, TransitionIndexedPointed z m, TransitionIndexedMonad z m) => (a -> m b x (const x)) -> t a -> m () x (const x)
58 | traverse_ f = foldr (\x,acc => (f x) >>>= (const acc)) (pure ())
62 | sequence_ : (Foldable t, TransitionIndexedPointed z m, TransitionIndexedMonad z m) => t (m a x (const x)) -> m () x (const x)
63 | sequence_ = foldr (\x, acc => x >>>= (const acc)) (pure ())
67 | for_ : (Foldable t, TransitionIndexedPointed z m, TransitionIndexedMonad z m) => t a -> (a -> m b x (const x)) -> m () x (const x)
68 | for_ = flip traverse_