unique-logic-0.3: Solve simple simultaneous equations

Safe HaskellSafe
LanguageHaskell98

UniqueLogic.ST.System

Contents

Synopsis

Preparation

class Var var where Source #

Minimal complete definition

plainVariable, runApply, constant, localVariable

Methods

plainVariable :: var w s a -> Variable w s a Source #

runApply :: Monoid w => Apply w s a -> var w s a -> T w s () Source #

constant :: Monoid w => a -> T w s (var w s a) Source #

localVariable :: Monoid w => T w s (var w s a) Source #

Instances

Var Variable Source # 

Methods

plainVariable :: Variable w s a -> Variable w s a Source #

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

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

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

Var Variable Source # 

Methods

plainVariable :: Variable w s a -> Variable w s a Source #

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

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

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

data Variable w s a Source #

Instances

Var Variable Source # 

Methods

plainVariable :: Variable w s a -> Variable w s a Source #

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

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

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

plainVariable :: Var var => var w s a -> Variable w s 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 :: (Var var, Monoid w) => T w s (var w s a) Source #

constant :: (Var var, Monoid w) => a -> T w s (var w s a) Source #

assignment2 :: (Var var, Monoid w) => (a -> b) -> var w s a -> var w s b -> T w s () Source #

assignment3 :: (Var var, Monoid w) => (a -> b -> c) -> var w s a -> var w s b -> var w s c -> T w s () Source #

data Apply w s a Source #

Instances

Monoid w => 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 #

Monoid w => 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 :: (Var var, Monoid w) => var w s a -> Apply w s a Source #

runApply :: (Var var, Monoid w) => Apply w s a -> var w s a -> T w s () Source #

Solution

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

query :: (Var var, Monoid w) => var w s a -> ST s (Maybe a) Source #