unique-logic-0.4.0.1: Solve simple simultaneous equations
Safe HaskellSafe-Inferred
LanguageHaskell98

UniqueLogic.ST.System.Label

Synopsis

Preparation

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

Posing statements

type T w = T (WriterT w) Source #

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

Instances details
Applicative (Apply w s) Source # 
Instance details

Defined in UniqueLogic.ST.System

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 #

Functor (Apply w s) Source # 
Instance details

Defined in UniqueLogic.ST.System

Methods

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

(<$) :: 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 #