mad-props-0.2.1.0: Monadic DSL for building constraint solvers using basic propagators.

Safe HaskellNone
LanguageHaskell2010

Props.Internal.Backtracking

Documentation

newtype Backtrack a Source #

Constructors

Backtrack (StateT BState (RandT StdGen Logic) a) 
Instances
Monad Backtrack Source # 
Instance details

Defined in Props.Internal.Backtracking

Methods

(>>=) :: Backtrack a -> (a -> Backtrack b) -> Backtrack b #

(>>) :: Backtrack a -> Backtrack b -> Backtrack b #

return :: a -> Backtrack a #

fail :: String -> Backtrack a #

Functor Backtrack Source # 
Instance details

Defined in Props.Internal.Backtracking

Methods

fmap :: (a -> b) -> Backtrack a -> Backtrack b #

(<$) :: a -> Backtrack b -> Backtrack a #

Applicative Backtrack Source # 
Instance details

Defined in Props.Internal.Backtracking

Methods

pure :: a -> Backtrack a #

(<*>) :: Backtrack (a -> b) -> Backtrack a -> Backtrack b #

liftA2 :: (a -> b -> c) -> Backtrack a -> Backtrack b -> Backtrack c #

(*>) :: Backtrack a -> Backtrack b -> Backtrack b #

(<*) :: Backtrack a -> Backtrack b -> Backtrack a #

MonadRandom Backtrack Source # 
Instance details

Defined in Props.Internal.Backtracking

Methods

getRandomR :: Random a => (a, a) -> Backtrack a #

getRandom :: Random a => Backtrack a #

getRandomRs :: Random a => (a, a) -> Backtrack [a] #

getRandoms :: Random a => Backtrack [a] #

Alternative Backtrack Source # 
Instance details

Defined in Props.Internal.Backtracking

Methods

empty :: Backtrack a #

(<|>) :: Backtrack a -> Backtrack a -> Backtrack a #

some :: Backtrack a -> Backtrack [a] #

many :: Backtrack a -> Backtrack [a] #

MonadState BState Backtrack Source # 
Instance details

Defined in Props.Internal.Backtracking

Methods

get :: Backtrack BState #

put :: BState -> Backtrack () #

state :: (BState -> (a, BState)) -> Backtrack a #

rselect :: Foldable f => f a -> Backtrack a Source #

select :: Foldable f => f a -> Backtrack a Source #