definitive-base-2.6.3: A small Prelude wrapper to simplify my own Haskell developments

Safe HaskellNone
LanguageHaskell2010

Algebra.Monad.Free

Documentation

data Free f a Source #

Constructors

Join (Forest f a) 
Pure a 

Instances

ConcreteMonad Free Source # 

Methods

generalize :: Monad m => Free Id a -> Free m a Source #

MonadTrans Free Source # 

Methods

lift :: Monad m => m a -> Free m a Source #

MonadCounter w a m => MonadCounter w a (Free m) Source # 

Methods

getCounter :: Free m a Source #

setCounter :: a -> Free m () Source #

MonadFuture m t => MonadFuture m (Free t) Source # 

Methods

future :: m a -> Free t a Source #

MonadError e m => MonadError e (Free m) Source # 

Methods

throw :: e -> Free m a Source #

catch :: (e -> Free m a) -> Free m a -> Free m a Source #

MonadWriter w m => MonadWriter w (Free m) Source # 

Methods

tell :: w -> Free m () Source #

listen :: Free m a -> Free m (w, a) Source #

censor :: Free m (a, w -> w) -> Free m a Source #

MonadReader r m => MonadReader r (Free m) Source # 

Methods

ask :: Free m r Source #

local :: (r -> r) -> Free m a -> Free m a Source #

MonadState s m => MonadState s (Free m) Source # 

Methods

get :: Free m s Source #

put :: s -> Free m () Source #

modify :: (s -> s) -> Free m () Source #

MonadFree m (Free m) Source # 

Methods

step :: Monad m => Free m a -> m (Free m a) Source #

perform :: Monad m => Free m a -> m a Source #

liftF :: Functor m => m a -> Free m a Source #

Unit (Zip (Free f)) Source # 

Methods

pure :: a -> Zip (Free f) a Source #

Unit (Free f) Source # 

Methods

pure :: a -> Free f a Source #

MonadList m => MonadList (Free m) Source # 

Methods

choose :: [a] -> Free m a Source #

MonadIO m => MonadIO (Free m) Source # 

Methods

liftIO :: IO a -> Free m a Source #

MonadFix f => MonadFix (Free f) Source # 

Methods

mfix :: (a -> Free f a) -> Free f a Source #

Traversable f => Traversable (Free f) Source # 

Methods

sequence :: Applicative f => Free f (f a) -> f (Free f a) Source #

Foldable f => Foldable (Free f) Source # 

Methods

fold :: Monoid m => Free f m -> m Source #

Comonad f => Comonad (Free f) Source # 

Methods

duplicate :: Free f a -> Free f (Free f a) Source #

(=>>) :: Free f a -> (Free f a -> b) -> Free f b Source #

Counit f => Counit (Free f) Source # 

Methods

extract :: Free f a -> a Source #

Functor f => Monad (Free f) Source # 

Methods

join :: Free f (Free f a) -> Free f a Source #

(>>=) :: Free f a -> (a -> Free f b) -> Free f b Source #

(Functor f, Applicative (Zip f)) => Applicative (Zip (Free f)) Source # 
Functor f => Applicative (Free f) Source # 
(Functor f, SemiApplicative (Zip f)) => SemiApplicative (Zip (Free f)) Source # 

Methods

(<*>) :: Zip (Free f) (a -> b) -> Zip (Free f) a -> Zip (Free f) b Source #

Functor f => SemiApplicative (Free f) Source # 

Methods

(<*>) :: Free f (a -> b) -> Free f a -> Free f b Source #

Functor f => Functor (Free f) Source # 

Methods

map :: (a -> b) -> Free f a -> Free f b Source #

(Eq (f (Free f a)), Eq a) => Eq (Free f a) Source # 

Methods

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

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

(Ord (f (Free f a)), Ord a) => Ord (Free f a) Source # 

Methods

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

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

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

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

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

max :: Free f a -> Free f a -> Free f a #

min :: Free f a -> Free f a -> Free f a #

(Show (f (Free f a)), Show a) => Show (Free f a) Source # 

Methods

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

show :: Free f a -> String #

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

Generic (Free f a) Source # 

Associated Types

type Rep (Free f a) :: * -> * #

Methods

from :: Free f a -> Rep (Free f a) x #

to :: Rep (Free f a) x -> Free f a #

(NFData (Forest f a), NFData a) => NFData (Free f a) Source # 

Methods

rnf :: Free f a -> () #

Monoid (f (Free f a)) => Monoid (Free f a) Source # 

Methods

zero :: Free f a Source #

Semigroup (f (Free f a)) => Semigroup (Free f a) Source # 

Methods

(+) :: Free f a -> Free f a -> Free f a Source #

DataMap (f (Free f a)) k (Free f a) => DataMap (Free f a) [k] (Free f a) Source # 

Methods

at :: [k] -> Lens' (Free f a) (Maybe (Free f a)) Source #

type Rep (Free f a) Source # 
type Rep (Free f a) = D1 (MetaData "Free" "Algebra.Monad.Free" "definitive-base-2.6.3-BgsdD2KswOiCr4UTIn8qyI" False) ((:+:) (C1 (MetaCons "Join" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Forest f a)))) (C1 (MetaCons "Pure" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a))))

type Forest f a = f (Free f a) Source #

t'Join :: Traversal (f (Free f a)) (g (Free g a)) (Free f a) (Free g a) Source #

concrete :: Monad m => Free m a -> m (Free Id a) Source #

unliftF :: Monad m => Free m a -> Free m (m a) Source #

mapF :: (Functor f, Functor g) => (forall a. f a -> g a) -> Free f b -> Free g b Source #

sequenceF :: (Traversable f, Monad g) => Free (g :.: f) a -> g (Free f a) Source #

traverseF :: (Functor f, Traversable f', Monad g) => (forall a. f a -> g (f' a)) -> Free f b -> g (Free f' b) Source #

class MonadFree m f | f -> m where Source #

Minimal complete definition

step, perform, liftF

Methods

step :: Monad m => f a -> m (f a) Source #

perform :: Monad m => f a -> m a Source #

liftF :: Functor m => m a -> f a Source #

Instances

MonadFree m (Free m) Source # 

Methods

step :: Monad m => Free m a -> m (Free m a) Source #

perform :: Monad m => Free m a -> m a Source #

liftF :: Functor m => m a -> Free m a Source #

coerceStep :: forall m f g a. (Monad m, MonadFree m f) => (f a -> g a) -> g a -> m (g a) Source #

coercePerform :: forall m f g a. (Monad m, MonadFree m f) => (f a -> g a) -> g a -> m a Source #

coerceLiftF :: forall m f g a. (Functor m, MonadFree m f) => (f a -> g a) -> m a -> g a Source #

data Cofree w a Source #

Constructors

Step a (Coforest w a) 

Instances

Lens1 a a (Cofree f a) (Cofree f a) Source # 

Methods

l'1 :: Lens a a (Cofree f a) (Cofree f a) Source #

Unit m => Unit (Cofree m) Source # 

Methods

pure :: a -> Cofree m a Source #

Traversable w => Traversable (Cofree w) Source # 

Methods

sequence :: Applicative f => Cofree w (f a) -> f (Cofree w a) Source #

Foldable w => Foldable (Cofree w) Source # 

Methods

fold :: Monoid m => Cofree w m -> m Source #

Functor w => Comonad (Cofree w) Source # 

Methods

duplicate :: Cofree w a -> Cofree w (Cofree w a) Source #

(=>>) :: Cofree w a -> (Cofree w a -> b) -> Cofree w b Source #

Counit (Cofree w) Source # 

Methods

extract :: Cofree w a -> a Source #

Applicative m => Monad (Cofree m) Source # 

Methods

join :: Cofree m (Cofree m a) -> Cofree m a Source #

(>>=) :: Cofree m a -> (a -> Cofree m b) -> Cofree m b Source #

Applicative m => Applicative (Cofree m) Source # 
Applicative m => SemiApplicative (Cofree m) Source # 

Methods

(<*>) :: Cofree m (a -> b) -> Cofree m a -> Cofree m b Source #

Functor w => Functor (Cofree w) Source # 

Methods

map :: (a -> b) -> Cofree w a -> Cofree w b Source #

Lens2 (f (Cofree f a)) (f (Cofree f a)) (Cofree f a) (Cofree f a) Source # 

Methods

l'2 :: Lens (f (Cofree f a)) (f (Cofree f a)) (Cofree f a) (Cofree f a) Source #

(Eq a, Eq (Coforest f a)) => Eq (Cofree f a) Source # 

Methods

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

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

(Ord a, Ord (Coforest f a)) => Ord (Cofree f a) Source # 

Methods

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

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

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

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

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

max :: Cofree f a -> Cofree f a -> Cofree f a #

min :: Cofree f a -> Cofree f a -> Cofree f a #

(Show a, Show (Coforest f a)) => Show (Cofree f a) Source # 

Methods

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

show :: Cofree f a -> String #

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

type Coforest w a = w (Cofree w a) Source #

type Bifree f a = Cofree (Free f) a Source #

newtype ContC k a b Source #

Constructors

ContC 

Fields

Instances

Category (ContC k) Source # 

Methods

id :: ContC k a a Source #

Deductive (ContC k) Source # 

Methods

(.) :: ContC k b c -> ContC k a b -> ContC k a c Source #

contC :: (Category k, Category k') => Iso (ContC k a b) (ContC k' a' b') (k a b) (k' a' b') Source #