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

Safe HaskellSafe
LanguageHaskell98

UniqueLogic.ST.TF.System

Contents

Synopsis

Preparation

data Variable w s a Source #

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

Handle duplicates

class C w => C w Source #

Minimal complete definition

update

Instances
C Track Source # 
Instance details

Defined in UniqueLogic.ST.TF.Example.Verify

Methods

update :: (Value Track a, C s) => Updater Track s a Source #

Monoid w => C (WriterT w) Source # 
Instance details

Defined in UniqueLogic.ST.TF.System

Methods

update :: (Value (WriterT w) a, C s) => Updater (WriterT w) s a Source #

C (IdentityT :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in UniqueLogic.ST.TF.System

Methods

update :: (Value IdentityT a, C s) => Updater IdentityT s a Source #

Inconsistency e => C (ExceptT e) Source # 
Instance details

Defined in UniqueLogic.ST.TF.System

Methods

update :: (Value (ExceptT e) a, C s) => Updater (ExceptT e) s a Source #

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

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

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

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

class C t => Fragile t where Source #

Methods

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

Instances
Inconsistency e => Fragile (ExceptT e) Source # 
Instance details

Defined in UniqueLogic.ST.TF.System

Methods

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

class C w => Value w a Source #

Minimal complete definition

valueConstraint

Instances
ToTrackedNumber tn => Value Track tn Source # 
Instance details

Defined in UniqueLogic.ST.TF.Example.Verify

Associated Types

data ValueConstraint Track tn :: Type Source #

Methods

valueConstraint :: T s (Updates Track s) -> T s (Maybe tn) -> ValueConstraint Track tn Source #

Monoid w => Value (WriterT w) a Source # 
Instance details

Defined in UniqueLogic.ST.TF.System

Associated Types

data ValueConstraint (WriterT w) a :: Type Source #

Methods

valueConstraint :: T s (Updates (WriterT w) s) -> T s (Maybe a) -> ValueConstraint (WriterT w) a Source #

Value (IdentityT :: (Type -> Type) -> Type -> Type) a Source # 
Instance details

Defined in UniqueLogic.ST.TF.System

Associated Types

data ValueConstraint IdentityT a :: Type Source #

Methods

valueConstraint :: T s (Updates IdentityT s) -> T s (Maybe a) -> ValueConstraint IdentityT a Source #

(Inconsistency e, Eq a) => Value (ExceptT e) a Source # 
Instance details

Defined in UniqueLogic.ST.TF.System

Associated Types

data ValueConstraint (ExceptT e) a :: Type Source #

Methods

valueConstraint :: T s (Updates (ExceptT e) s) -> T s (Maybe a) -> ValueConstraint (ExceptT e) a Source #

data family ValueConstraint w a :: * Source #

Instances
data ValueConstraint Track tn Source # 
Instance details

Defined in UniqueLogic.ST.TF.Example.Verify

data ValueConstraint (WriterT w) a Source # 
Instance details

Defined in UniqueLogic.ST.TF.System

data ValueConstraint (IdentityT :: (Type -> Type) -> Type -> Type) a Source # 
Instance details

Defined in UniqueLogic.ST.TF.System

data ValueConstraint (ExceptT e) a Source # 
Instance details

Defined in UniqueLogic.ST.TF.System

data ValueConstraint (ExceptT e) a where

valueConstraint :: Value w a => T s (Updates w s) -> T s (Maybe a) -> ValueConstraint w a Source #

Posing statements

data T w s a Source #

Instances
C s => Monad (T w s) Source # 
Instance details

Defined in UniqueLogic.ST.TF.System

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 #

C s => Functor (T w s) Source # 
Instance details

Defined in UniqueLogic.ST.TF.System

Methods

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

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

C s => Applicative (T w s) Source # 
Instance details

Defined in UniqueLogic.ST.TF.System

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, Value w a, C s) => T w s (Variable w s a) Source #

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

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

assignment2 f a b = runApply (f <$> arg a) b

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

assignment3 f a b c = runApply (liftA2 f (arg a) (arg b)) c

data Apply w s a Source #

Instances
C s => Functor (Apply w s) Source # 
Instance details

Defined in UniqueLogic.ST.TF.System

Methods

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

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

C s => Applicative (Apply w s) Source # 
Instance details

Defined in UniqueLogic.ST.TF.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 #

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, C s) => Apply w s a -> Variable w s a -> T w s () Source #

runApplyMaybe :: (C w, C s) => Apply w s (Maybe a) -> Variable w s a -> T w s () Source #

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

Solution

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

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

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

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