effect-handlers-0.1.0.0

Safe HaskellNone
LanguageHaskell2010

Control.Effects.Cont.Search

Synopsis

Documentation

This module provides the familiar reader effect.

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) 
Typeable (* -> * -> *) Search 

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.