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 #

A proxy for passing type to functions. Example > foo

Constructors

T 

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

data Search w a #

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) # 

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 #

Nondeterministicaly choose an element from a list

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

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

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

Use a strict depth first search. Equal to using ListT

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

Lazy depth first search with backtracking.