hedgehog-0.6.1: Hedgehog will eat all your bugs.

Safe HaskellNone
LanguageHaskell98

Hedgehog.Internal.Tree

Synopsis

Documentation

newtype Tree m a Source #

An effectful tree, each node in the tree can have an effect before it is produced.

Constructors

Tree 

Fields

Instances
MMonad Tree Source # 
Instance details

Defined in Hedgehog.Internal.Tree

Methods

embed :: Monad n => (forall a. m a -> Tree n a) -> Tree m b -> Tree n b #

MonadTrans Tree Source # 
Instance details

Defined in Hedgehog.Internal.Tree

Methods

lift :: Monad m => m a -> Tree m a #

Distributive Tree Source # 
Instance details

Defined in Hedgehog.Internal.Tree

Associated Types

type Transformer f Tree m :: Constraint Source #

Methods

distribute :: Transformer f Tree m => Tree (f m) a -> f (Tree m) a Source #

MonadBase b m => MonadBase b (Tree m) Source # 
Instance details

Defined in Hedgehog.Internal.Tree

Methods

liftBase :: b α -> Tree m α #

MonadWriter w m => MonadWriter w (Tree m) Source # 
Instance details

Defined in Hedgehog.Internal.Tree

Methods

writer :: (a, w) -> Tree m a #

tell :: w -> Tree m () #

listen :: Tree m a -> Tree m (a, w) #

pass :: Tree m (a, w -> w) -> Tree m a #

MonadState s m => MonadState s (Tree m) Source # 
Instance details

Defined in Hedgehog.Internal.Tree

Methods

get :: Tree m s #

put :: s -> Tree m () #

state :: (s -> (a, s)) -> Tree m a #

MonadReader r m => MonadReader r (Tree m) Source # 
Instance details

Defined in Hedgehog.Internal.Tree

Methods

ask :: Tree m r #

local :: (r -> r) -> Tree m a -> Tree m a #

reader :: (r -> a) -> Tree m a #

MonadError e m => MonadError e (Tree m) Source # 
Instance details

Defined in Hedgehog.Internal.Tree

Methods

throwError :: e -> Tree m a #

catchError :: Tree m a -> (e -> Tree m a) -> Tree m a #

Monad m => Monad (Tree m) Source # 
Instance details

Defined in Hedgehog.Internal.Tree

Methods

(>>=) :: Tree m a -> (a -> Tree m b) -> Tree m b #

(>>) :: Tree m a -> Tree m b -> Tree m b #

return :: a -> Tree m a #

fail :: String -> Tree m a #

Functor m => Functor (Tree m) Source # 
Instance details

Defined in Hedgehog.Internal.Tree

Methods

fmap :: (a -> b) -> Tree m a -> Tree m b #

(<$) :: a -> Tree m b -> Tree m a #

Monad m => Applicative (Tree m) Source # 
Instance details

Defined in Hedgehog.Internal.Tree

Methods

pure :: a -> Tree m a #

(<*>) :: Tree m (a -> b) -> Tree m a -> Tree m b #

liftA2 :: (a -> b -> c) -> Tree m a -> Tree m b -> Tree m c #

(*>) :: Tree m a -> Tree m b -> Tree m b #

(<*) :: Tree m a -> Tree m b -> Tree m a #

Show1 m => Show1 (Tree m) Source # 
Instance details

Defined in Hedgehog.Internal.Tree

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Tree m a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Tree m a] -> ShowS #

MonadIO m => MonadIO (Tree m) Source # 
Instance details

Defined in Hedgehog.Internal.Tree

Methods

liftIO :: IO a -> Tree m a #

MonadPlus m => Alternative (Tree m) Source # 
Instance details

Defined in Hedgehog.Internal.Tree

Methods

empty :: Tree m a #

(<|>) :: Tree m a -> Tree m a -> Tree m a #

some :: Tree m a -> Tree m [a] #

many :: Tree m a -> Tree m [a] #

MonadPlus m => MonadPlus (Tree m) Source # 
Instance details

Defined in Hedgehog.Internal.Tree

Methods

mzero :: Tree m a #

mplus :: Tree m a -> Tree m a -> Tree m a #

MonadCatch m => MonadCatch (Tree m) Source # 
Instance details

Defined in Hedgehog.Internal.Tree

Methods

catch :: Exception e => Tree m a -> (e -> Tree m a) -> Tree m a #

MonadThrow m => MonadThrow (Tree m) Source # 
Instance details

Defined in Hedgehog.Internal.Tree

Methods

throwM :: Exception e => e -> Tree m a #

PrimMonad m => PrimMonad (Tree m) Source # 
Instance details

Defined in Hedgehog.Internal.Tree

Associated Types

type PrimState (Tree m) :: * #

Methods

primitive :: (State# (PrimState (Tree m)) -> (#State# (PrimState (Tree m)), a#)) -> Tree m a #

MonadResource m => MonadResource (Tree m) Source # 
Instance details

Defined in Hedgehog.Internal.Tree

Methods

liftResourceT :: ResourceT IO a -> Tree m a #

MFunctor Tree Source # 
Instance details

Defined in Hedgehog.Internal.Tree

Methods

hoist :: Monad m => (forall a. m a -> n a) -> Tree m b -> Tree n b #

(Show1 m, Show a) => Show (Tree m a) Source # 
Instance details

Defined in Hedgehog.Internal.Tree

Methods

showsPrec :: Int -> Tree m a -> ShowS #

show :: Tree m a -> String #

showList :: [Tree m a] -> ShowS #

type Transformer f Tree m Source # 
Instance details

Defined in Hedgehog.Internal.Tree

type Transformer f Tree m = (Monad m, Monad (f m), Monad (Tree m), Monad (f (Tree m)), MonadTrans f, MFunctor f)
type PrimState (Tree m) Source # 
Instance details

Defined in Hedgehog.Internal.Tree

type PrimState (Tree m) = PrimState m

data Node m a Source #

A node in an effectful tree, as well as its unevaluated children.

Constructors

Node 

Fields

Instances
Monad m => Monad (Node m) Source # 
Instance details

Defined in Hedgehog.Internal.Tree

Methods

(>>=) :: Node m a -> (a -> Node m b) -> Node m b #

(>>) :: Node m a -> Node m b -> Node m b #

return :: a -> Node m a #

fail :: String -> Node m a #

Functor m => Functor (Node m) Source # 
Instance details

Defined in Hedgehog.Internal.Tree

Methods

fmap :: (a -> b) -> Node m a -> Node m b #

(<$) :: a -> Node m b -> Node m a #

Monad m => Applicative (Node m) Source # 
Instance details

Defined in Hedgehog.Internal.Tree

Methods

pure :: a -> Node m a #

(<*>) :: Node m (a -> b) -> Node m a -> Node m b #

liftA2 :: (a -> b -> c) -> Node m a -> Node m b -> Node m c #

(*>) :: Node m a -> Node m b -> Node m b #

(<*) :: Node m a -> Node m b -> Node m a #

Show1 m => Show1 (Node m) Source # 
Instance details

Defined in Hedgehog.Internal.Tree

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Node m a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Node m a] -> ShowS #

MFunctor Node Source # 
Instance details

Defined in Hedgehog.Internal.Tree

Methods

hoist :: Monad m => (forall a. m a -> n a) -> Node m b -> Node n b #

(Show1 m, Show a) => Show (Node m a) Source # 
Instance details

Defined in Hedgehog.Internal.Tree

Methods

showsPrec :: Int -> Node m a -> ShowS #

show :: Node m a -> String #

showList :: [Node m a] -> ShowS #

fromNode :: Applicative m => Node m a -> Tree m a Source #

Create a Tree from a Node

unfold :: Monad m => (a -> [a]) -> a -> Tree m a Source #

Create a tree from a value and an unfolding function.

unfoldForest :: Monad m => (a -> [a]) -> a -> [Tree m a] Source #

Create a forest from a value and an unfolding function.

expand :: Monad m => (a -> [a]) -> Tree m a -> Tree m a Source #

Expand a tree using an unfolding function.

prune :: Monad m => Tree m a -> Tree m a Source #

Throw away a tree's children.

render :: Monad m => Tree m String -> m String Source #

Render a tree of strings, note that this forces all the delayed effects in the tree.