lambda-uc-0.1.0.0
Safe HaskellSafe
LanguageGHC2021

Control.XFreer.Join

Synopsis

Documentation

data XFree f p q a where #

XFree is the freer indexed monad that wraps an (algebraic, non-composable) effect to provide Functor, XApplicative and XMonad (indexed applicative and monad) for free.

Constructors

Pure :: a -> XFree f p p a 
Join :: f p q (XFree f q r a) -> XFree f p r a 

Instances

Instances details
(forall (p' :: k) (q' :: k). Functor (f p' q')) => XApplicative (XFree f :: k -> k -> Type -> Type) # 
Instance details

Defined in Control.XFreer.Join

Methods

xpure :: forall a (p :: k0). a -> XFree f p p a #

(<*>:) :: forall (p :: k0) (q :: k0) a b (r :: k0). XFree f p q (a -> b) -> XFree f q r a -> XFree f p r b #

xliftA2 :: forall a b c (p :: k0) (q :: k0) (r :: k0). (a -> b -> c) -> XFree f p q a -> XFree f q r b -> XFree f p r c #

(*>:) :: forall (p :: k0) (q :: k0) a (r :: k0) b. XFree f p q a -> XFree f q r b -> XFree f p r b #

(<*:) :: forall (p :: k0) (q :: k0) a (r :: k0) b. XFree f p q a -> XFree f q r b -> XFree f p r a #

(forall (p' :: k) (q' :: k). Functor (f p' q')) => XMonad (XFree f :: k -> k -> Type -> Type) # 
Instance details

Defined in Control.XFreer.Join

Methods

(>>=:) :: forall a b (p :: k0) (q :: k0) (r :: k0). XFree f p q a -> (a -> XFree f q r b) -> XFree f p r b #

(>>:) :: forall a b (p :: k0) (q :: k0) (r :: k0). XFree f p q a -> XFree f q r b -> XFree f p r b #

xreturn :: forall a (p :: k0). a -> XFree f p p a #

(forall (p' :: k) (q' :: k). Functor (f p' q'), p ~ q) => Applicative (XFree f p q) #

XFree (f p p) is a normal Applicative, it supports forever, traverse, sequenceA, etc.

Instance details

Defined in Control.XFreer.Join

Methods

pure :: a -> XFree f p q a #

(<*>) :: XFree f p q (a -> b) -> XFree f p q a -> XFree f p q b #

liftA2 :: (a -> b -> c) -> XFree f p q a -> XFree f p q b -> XFree f p q c #

(*>) :: XFree f p q a -> XFree f p q b -> XFree f p q b #

(<*) :: XFree f p q a -> XFree f p q b -> XFree f p q a #

(forall (p' :: k) (q' :: k). Functor (f p' q')) => Functor (XFree f p q) # 
Instance details

Defined in Control.XFreer.Join

Methods

fmap :: (a -> b) -> XFree f p q a -> XFree f p q b #

(<$) :: a -> XFree f p q b -> XFree f p q a #

(forall (p' :: k) (q' :: k). Functor (f p' q'), p ~ q) => Monad (XFree f p q) #

XFree (f p p) is a normal Monad, it supports mapM, forM, sequence, etc.

Instance details

Defined in Control.XFreer.Join

Methods

(>>=) :: XFree f p q a -> (a -> XFree f p q b) -> XFree f p q b #

(>>) :: XFree f p q a -> XFree f p q b -> XFree f p q b #

return :: a -> XFree f p q a #

xfree :: (forall p' q'. Functor (f p' q')) => f p q a -> XFree f p q a #

Function to convert an indexed effect to XFree monad (see example above)