effect-handlers-0.1.0.8: A library for writing extensible algebraic effects and handlers. Similar to extensible-effects but with deep handlers.

Safe HaskellNone
LanguageHaskell2010

Control.Effects.Search

Synopsis

Documentation

data T a Source #

A proxy for passing type to functions. Example > foo

Constructors

T 

asT :: a -> T a -> a Source #

data Search w a Source #

The functor representing the effect. You shouldn't need to create this manually, just use choose or searchFail.

Constructors

SChoose [w] (w -> a) 

Instances

Functor (Search w) Source # 

Methods

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

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

choose :: (Member (Search w) r, Typeable w) => [w] -> Eff r w Source #

Nondeterministicaly choose an element from a list

searchFail :: (Member (Search w) r, Typeable w) => T w -> Eff r () Source #

Fail a search. Equal to choosing from an empty list.

handleDFS :: Handler (Search w) r a [a] Source #

Use a strict depth first search. Equal to using ListT

handleBacktrackMaybe :: Handler (Search w) r a (Maybe a) Source #

Lazy depth first search with backtracking.