heftia-0.3.1.0: higher-order effects done right
Copyright(c) 2023 Yamada Ryo
LicenseMPL-2.0 (see the file LICENSE)
Maintainerymdfield@outlook.jp
Stabilityexperimental
Portabilityportable
Safe HaskellSafe-Inferred
LanguageGHC2021

Control.Monad.Freer.Tree

Description

A tree-structured encoded Freer monad.

Synopsis

Documentation

newtype FreerTree f a Source #

A tree-structured encoded Freer monad.

Constructors

FreerTree 

Fields

Instances

Instances details
Freer Monad FreerTree Source # 
Instance details

Defined in Control.Monad.Freer.Tree

Methods

liftIns :: e a -> FreerTree e a Source #

interpretFreer :: forall m (e :: Type -> Type) a. Monad m => (e ~> m) -> FreerTree e a -> m a Source #

retractFreer :: Monad m => FreerTree m a -> m a Source #

transformFreer :: forall (e :: Type -> Type) (e' :: Type -> Type) a. (e ~> e') -> FreerTree e a -> FreerTree e' a Source #

reinterpretFreer :: forall (e :: Type -> Type) a. (e ~> FreerTree e) -> FreerTree e a -> FreerTree e a Source #

MonadFreer Monad FreerTree Source # 
Instance details

Defined in Control.Monad.Freer.Tree

Methods

interpretFreerK :: forall (e :: Type -> Type) r. (e ~> Cont r) -> FreerTree e ~> Cont r Source #

Foldable f => Foldable (FreerTree f) Source # 
Instance details

Defined in Control.Monad.Freer.Tree

Methods

fold :: Monoid m => FreerTree f m -> m #

foldMap :: Monoid m => (a -> m) -> FreerTree f a -> m #

foldMap' :: Monoid m => (a -> m) -> FreerTree f a -> m #

foldr :: (a -> b -> b) -> b -> FreerTree f a -> b #

foldr' :: (a -> b -> b) -> b -> FreerTree f a -> b #

foldl :: (b -> a -> b) -> b -> FreerTree f a -> b #

foldl' :: (b -> a -> b) -> b -> FreerTree f a -> b #

foldr1 :: (a -> a -> a) -> FreerTree f a -> a #

foldl1 :: (a -> a -> a) -> FreerTree f a -> a #

toList :: FreerTree f a -> [a] #

null :: FreerTree f a -> Bool #

length :: FreerTree f a -> Int #

elem :: Eq a => a -> FreerTree f a -> Bool #

maximum :: Ord a => FreerTree f a -> a #

minimum :: Ord a => FreerTree f a -> a #

sum :: Num a => FreerTree f a -> a #

product :: Num a => FreerTree f a -> a #

Traversable f => Traversable (FreerTree f) Source # 
Instance details

Defined in Control.Monad.Freer.Tree

Methods

traverse :: Applicative f0 => (a -> f0 b) -> FreerTree f a -> f0 (FreerTree f b) #

sequenceA :: Applicative f0 => FreerTree f (f0 a) -> f0 (FreerTree f a) #

mapM :: Monad m => (a -> m b) -> FreerTree f a -> m (FreerTree f b) #

sequence :: Monad m => FreerTree f (m a) -> m (FreerTree f a) #

Alternative f => Alternative (FreerTree f) Source # 
Instance details

Defined in Control.Monad.Freer.Tree

Methods

empty :: FreerTree f a #

(<|>) :: FreerTree f a -> FreerTree f a -> FreerTree f a #

some :: FreerTree f a -> FreerTree f [a] #

many :: FreerTree f a -> FreerTree f [a] #

Applicative (FreerTree f) Source # 
Instance details

Defined in Control.Monad.Freer.Tree

Methods

pure :: a -> FreerTree f a #

(<*>) :: FreerTree f (a -> b) -> FreerTree f a -> FreerTree f b #

liftA2 :: (a -> b -> c) -> FreerTree f a -> FreerTree f b -> FreerTree f c #

(*>) :: FreerTree f a -> FreerTree f b -> FreerTree f b #

(<*) :: FreerTree f a -> FreerTree f b -> FreerTree f a #

Functor (FreerTree f) Source # 
Instance details

Defined in Control.Monad.Freer.Tree

Methods

fmap :: (a -> b) -> FreerTree f a -> FreerTree f b #

(<$) :: a -> FreerTree f b -> FreerTree f a #

Monad (FreerTree f) Source # 
Instance details

Defined in Control.Monad.Freer.Tree

Methods

(>>=) :: FreerTree f a -> (a -> FreerTree f b) -> FreerTree f b #

(>>) :: FreerTree f a -> FreerTree f b -> FreerTree f b #

return :: a -> FreerTree f a #

MonadPlus f => MonadPlus (FreerTree f) Source # 
Instance details

Defined in Control.Monad.Freer.Tree

Methods

mzero :: FreerTree f a #

mplus :: FreerTree f a -> FreerTree f a -> FreerTree f a #

(Read1 f, Read a) => Read (FreerTree f a) Source # 
Instance details

Defined in Control.Monad.Freer.Tree

(Functor f, Show1 f, Show a) => Show (FreerTree f a) Source # 
Instance details

Defined in Control.Monad.Freer.Tree

Methods

showsPrec :: Int -> FreerTree f a -> ShowS #

show :: FreerTree f a -> String #

showList :: [FreerTree f a] -> ShowS #

(Eq1 f, Eq a) => Eq (FreerTree f a) Source # 
Instance details

Defined in Control.Monad.Freer.Tree

Methods

(==) :: FreerTree f a -> FreerTree f a -> Bool #

(/=) :: FreerTree f a -> FreerTree f a -> Bool #

(Ord1 f, Ord a) => Ord (FreerTree f a) Source # 
Instance details

Defined in Control.Monad.Freer.Tree

Methods

compare :: FreerTree f a -> FreerTree f a -> Ordering #

(<) :: FreerTree f a -> FreerTree f a -> Bool #

(<=) :: FreerTree f a -> FreerTree f a -> Bool #

(>) :: FreerTree f a -> FreerTree f a -> Bool #

(>=) :: FreerTree f a -> FreerTree f a -> Bool #

max :: FreerTree f a -> FreerTree f a -> FreerTree f a #

min :: FreerTree f a -> FreerTree f a -> FreerTree f a #

liftInsTree :: ins a -> FreerTree ins a Source #

interpretTree :: Monad m => (ins ~> m) -> FreerTree ins a -> m a Source #