tree-monad-0.3.2: Non-Determinism Monad for Tree Search
CopyrightSebastian Fischer
LicenseBSD3
MaintainerNiels Bunkenburg (nbu@informatik.uni-kiel.de)
Stabilityexperimental
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Control.Monad.SearchTree

Description

This Haskell library provides an implementation of the MonadPlus type class that represents the search space as a tree whose constructors represent mzero, return, and mplus.

Such a tree can be used to implement different search strategies, e.g., by using a queue. It can also be used as a basis for parallel search strategies that evaluate different parts of the search space concurrently.

Synopsis

Documentation

data SearchTree a Source #

The type SearchTree a represents non-deterministic computations as a tree structure.

Constructors

None 
One a 
Choice (SearchTree a) (SearchTree a) 

Instances

Instances details
MonadFail SearchTree Source # 
Instance details

Defined in Control.Monad.SearchTree

Methods

fail :: String -> SearchTree a Source #

MonadFix SearchTree Source # 
Instance details

Defined in Control.Monad.SearchTree

Methods

mfix :: (a -> SearchTree a) -> SearchTree a Source #

Alternative SearchTree Source # 
Instance details

Defined in Control.Monad.SearchTree

Applicative SearchTree Source # 
Instance details

Defined in Control.Monad.SearchTree

Functor SearchTree Source # 
Instance details

Defined in Control.Monad.SearchTree

Methods

fmap :: (a -> b) -> SearchTree a -> SearchTree b Source #

(<$) :: a -> SearchTree b -> SearchTree a Source #

Monad SearchTree Source # 
Instance details

Defined in Control.Monad.SearchTree

MonadPlus SearchTree Source # 
Instance details

Defined in Control.Monad.SearchTree

Show a => Show (SearchTree a) Source # 
Instance details

Defined in Control.Monad.SearchTree

data Search a Source #

Another search monad based on continuations that produce search trees.

Instances

Instances details
MonadFail Search Source # 
Instance details

Defined in Control.Monad.SearchTree

Methods

fail :: String -> Search a Source #

MonadFix Search Source # 
Instance details

Defined in Control.Monad.SearchTree

Methods

mfix :: (a -> Search a) -> Search a Source #

Alternative Search Source # 
Instance details

Defined in Control.Monad.SearchTree

Methods

empty :: Search a Source #

(<|>) :: Search a -> Search a -> Search a Source #

some :: Search a -> Search [a] Source #

many :: Search a -> Search [a] Source #

Applicative Search Source # 
Instance details

Defined in Control.Monad.SearchTree

Methods

pure :: a -> Search a Source #

(<*>) :: Search (a -> b) -> Search a -> Search b Source #

liftA2 :: (a -> b -> c) -> Search a -> Search b -> Search c Source #

(*>) :: Search a -> Search b -> Search b Source #

(<*) :: Search a -> Search b -> Search a Source #

Functor Search Source # 
Instance details

Defined in Control.Monad.SearchTree

Methods

fmap :: (a -> b) -> Search a -> Search b Source #

(<$) :: a -> Search b -> Search a Source #

Monad Search Source # 
Instance details

Defined in Control.Monad.SearchTree

Methods

(>>=) :: Search a -> (a -> Search b) -> Search b Source #

(>>) :: Search a -> Search b -> Search b Source #

return :: a -> Search a Source #

MonadPlus Search Source # 
Instance details

Defined in Control.Monad.SearchTree

Methods

mzero :: Search a Source #

mplus :: Search a -> Search a -> Search a Source #

searchTree :: Search a -> SearchTree a Source #

Computes the SearchTree representation of a Search action.