unique-logic-tf-0.4.0.1: Solve simple simultaneous equations

Safe HaskellNone

UniqueLogic.ST.TF.System

Contents

Synopsis

Preparation

data Variable w s a Source

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

Handle duplicates

class C w => C w whereSource

Methods

update :: Value w a => Updater w s aSource

Instances

C IdentityT 
C Track 
Inconsistency e => C (ExceptionalT e) 
Monoid w => C (WriterT w) 

simpleUpdate :: (C w, Value w a) => SimpleUpdater w s aSource

updateIfNew :: C w => Updater w s aSource

updateAndCheck :: C w => (a -> a -> Wrap w (ST s) ()) -> Updater w s aSource

class C t => Fragile t whereSource

Methods

break :: Monad m => Wrap t m aSource

Instances

Inconsistency e => Fragile (ExceptionalT e) 

class C w => Value w a whereSource

Associated Types

data ValueConstraint w a :: *Source

Methods

valueConstraint :: STRef s (Updates w s) -> STRef s (Maybe a) -> ValueConstraint w aSource

Instances

Value IdentityT a 
ToTrackedNumber tn => Value Track tn 
(Inconsistency e, Eq a) => Value (ExceptionalT e) a 
Monoid w => Value (WriterT w) a 

Posing statements

data T w s a Source

Instances

Monad (T w s) 
Functor (T w s) 
Applicative (T w s) 

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

constant :: (C w, Value w 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

arg :: Variable w s a -> Apply w s aSource

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) aSource

solveDepthFirst :: C w => T w s a -> w (ST s) aSource

solveBreadthFirst :: C w => T w s a -> w (ST s) aSource

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