monad-tree-0.2.0.0: Tree data structure for nondeterministic computations.
Copyright(c) Nathan Bedell 2021
LicenseMIT
Maintainernbedell@tulane.edu
Safe HaskellSafe-Inferred
LanguageHaskell2010

Control.Monad.Trans.Tree

Description

This module contains the definition of a monad transformer for monadic trees.

Note that this implementation is still experimental, in the sense that the monad laws for these instances have _not_ been formally proven. Thus, this module should be used with caution.

Documentation

data TreeM n f m a Source #

Constructors

Leaf a 
Node n (m (f (TreeM n f m a))) 

Instances

Instances details
(Functor f, Functor m) => Functor (TreeM n f m) Source # 
Instance details

Defined in Control.Monad.Trans.Tree

Methods

fmap :: (a -> b) -> TreeM n f m a -> TreeM n f m b #

(<$) :: a -> TreeM n f m b -> TreeM n f m a #

newtype TreeT n f m a Source #

Constructors

TreeT 

Fields

Instances

Instances details
(MonadState s m, Traversable f) => MonadState s (TreeT n f m) Source # 
Instance details

Defined in Control.Monad.Trans.Tree

Methods

get :: TreeT n f m s #

put :: s -> TreeT n f m () #

state :: (s -> (a, s)) -> TreeT n f m a #

MonadTrans (TreeT n f) Source # 
Instance details

Defined in Control.Monad.Trans.Tree

Methods

lift :: Monad m => m a -> TreeT n f m a #

(Traversable f, Monad m) => Monad (TreeT n f m) Source # 
Instance details

Defined in Control.Monad.Trans.Tree

Methods

(>>=) :: TreeT n f m a -> (a -> TreeT n f m b) -> TreeT n f m b #

(>>) :: TreeT n f m a -> TreeT n f m b -> TreeT n f m b #

return :: a -> TreeT n f m a #

(Functor f, Functor m) => Functor (TreeT n f m) Source # 
Instance details

Defined in Control.Monad.Trans.Tree

Methods

fmap :: (a -> b) -> TreeT n f m a -> TreeT n f m b #

(<$) :: a -> TreeT n f m b -> TreeT n f m a #

(Monad m, Traversable f) => Applicative (TreeT n f m) Source # 
Instance details

Defined in Control.Monad.Trans.Tree

Methods

pure :: a -> TreeT n f m a #

(<*>) :: TreeT n f m (a -> b) -> TreeT n f m a -> TreeT n f m b #

liftA2 :: (a -> b -> c) -> TreeT n f m a -> TreeT n f m b -> TreeT n f m c #

(*>) :: TreeT n f m a -> TreeT n f m b -> TreeT n f m b #

(<*) :: TreeT n f m a -> TreeT n f m b -> TreeT n f m a #

(MonadIO m, Traversable f) => MonadIO (TreeT n f m) Source # 
Instance details

Defined in Control.Monad.Trans.Tree

Methods

liftIO :: IO a -> TreeT n f m a #

bind :: (Monad m, Functor f, Traversable f) => TreeT n f m a -> (a -> TreeT n f m b) -> TreeT n f m b Source #