unique-logic-0.4: Solve simple simultaneous equations

Safe HaskellSafe
LanguageHaskell98

UniqueLogic.ST.System

Contents

Synopsis

Preparation

data Variable w s a Source #

globalVariable :: (C w, C a) => SimpleUpdater w s a -> ST s (Variable w s a) Source #

Handle duplicates

class C w => C w where Source #

Minimal complete definition

doUpdate

Methods

doUpdate :: C a => Updater w s a Source #

Instances

C Track Source # 

Methods

doUpdate :: C a => Updater Track s a Source #

Inconsistency e => C (ExceptionalT e) Source # 

Methods

doUpdate :: C a => Updater (ExceptionalT e) s a Source #

Monoid w => C (WriterT w) Source # 

Methods

doUpdate :: C a => Updater (WriterT w) s a Source #

C (IdentityT *) Source # 

Methods

doUpdate :: C a => Updater (IdentityT *) s a Source #

doUpdate :: (C w, C a) => Updater w s a Source #

simpleUpdate :: (C w, C a) => SimpleUpdater w s a Source #

updateIfNew :: (C w, C a) => Updater w s a Source #

updateAndCheck :: (C w, C a) => (a -> a -> Wrap w (ST s) ()) -> Updater w s a Source #

class C t => Fragile t where Source #

Minimal complete definition

break

Methods

break :: Monad m => Wrap t m a Source #

Instances

Inconsistency e => Fragile (ExceptionalT e) Source # 

Methods

break :: Monad m => Wrap (ExceptionalT e) m a Source #

Posing statements

data T w s a Source #

Instances

Monad (T w s) Source # 

Methods

(>>=) :: T w s a -> (a -> T w s b) -> T w s b #

(>>) :: T w s a -> T w s b -> T w s b #

return :: a -> T w s a #

fail :: String -> T w s a #

Functor (T w s) Source # 

Methods

fmap :: (a -> b) -> T w s a -> T w s b #

(<$) :: a -> T w s b -> T w s a #

Applicative (T w s) Source # 

Methods

pure :: a -> T w s a #

(<*>) :: T w s (a -> b) -> T w s a -> T w s b #

liftA2 :: (a -> b -> c) -> T w s a -> T w s b -> T w s c #

(*>) :: T w s a -> T w s b -> T w s b #

(<*) :: T w s a -> T w s b -> T w s a #

localVariable :: (C w, C a) => T w s (Variable w s a) Source #

constant :: (C w, C a) => a -> T w s (Variable w s a) Source #

assignment2 :: C w => (a -> b) -> Variable w s a -> Variable w s b -> T w s () Source #

assignment3 :: C w => (a -> b -> c) -> Variable w s a -> Variable w s b -> Variable w s c -> T w s () Source #

data Apply w s a Source #

Instances

Functor (Apply w s) Source # 

Methods

fmap :: (a -> b) -> Apply w s a -> Apply w s b #

(<$) :: a -> Apply w s b -> Apply w s a #

Applicative (Apply w s) Source # 

Methods

pure :: a -> Apply w s a #

(<*>) :: Apply w s (a -> b) -> Apply w s a -> Apply w s b #

liftA2 :: (a -> b -> c) -> Apply w s a -> Apply w s b -> Apply w s c #

(*>) :: Apply w s a -> Apply w s b -> Apply w s b #

(<*) :: Apply w s a -> Apply w s b -> Apply w s a #

arg :: Variable w s a -> Apply w s a Source #

This function allows to generalize assignment2 and assignment3 to more arguments. You could achieve the same with nested applications of assignment3 (,).

runApply :: C w => Apply w s a -> Variable w s a -> T w s () Source #

Solution

solve :: C w => T w s a -> w (ST s) a Source #

query :: Variable w s a -> ST s (Maybe a) Source #

queryForbid :: Variable w s (Forbid a) -> ST s (Maybe a) Source #

queryIgnore :: Variable w s (Ignore a) -> ST s (Maybe a) Source #

queryVerify :: Variable w s (Verify a) -> ST s (Maybe a) Source #