unique-logic-0.3: Solve simple simultaneous equations

Safe HaskellSafe
LanguageHaskell98

UniqueLogic.ST.Rule

Contents

Synopsis

Custom rules

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

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

Common rules

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

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

You might be tempted to use the pair rule to collect parameters for rules with more than three arguments. This is generally not a good idea since this way you lose granularity. For building rules with more than three arguments, please build according assignments with arg and runApply and bundle these assignments to rules. This is the way, generic2 and generic3 work.

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

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

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

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

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