Safe Haskell | None |
---|
- data Variable w s a
- globalVariable :: (C w, Value w a) => SimpleUpdater w s a -> ST s (Variable w s a)
- class C w => C w where
- simpleUpdate :: (C w, Value w a) => SimpleUpdater w s a
- updateIfNew :: C w => Updater w s a
- updateAndCheck :: C w => (a -> a -> Wrap w (ST s) ()) -> Updater w s a
- class C t => Fragile t where
- class C w => Value w a where
- data ValueConstraint w a :: *
- valueConstraint :: STRef s (Updates w s) -> STRef s (Maybe a) -> ValueConstraint w a
- data T w s a
- localVariable :: (C w, Value w a) => T w s (Variable w s a)
- constant :: (C w, Value w a) => a -> T w s (Variable w s a)
- assignment2 :: C w => (a -> b) -> Variable w s a -> Variable w s b -> T w s ()
- assignment3 :: C w => (a -> b -> c) -> Variable w s a -> Variable w s b -> Variable w s c -> T w s ()
- data Apply w s a
- arg :: Variable w s a -> Apply w s a
- runApply :: C w => Apply w s a -> Variable w s a -> T w s ()
- solve :: C w => T w s a -> w (ST s) a
- solveDepthFirst :: C w => T w s a -> w (ST s) a
- solveBreadthFirst :: C w => T w s a -> w (ST s) a
- query :: Variable w s a -> ST s (Maybe a)
Preparation
Handle duplicates
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
Inconsistency e => Fragile (ExceptionalT e) |
class C w => Value w a whereSource
data ValueConstraint w a :: *Source
valueConstraint :: STRef s (Updates w s) -> STRef s (Maybe a) -> ValueConstraint w aSource
Posing statements
assignment3 :: C w => (a -> b -> c) -> Variable w s a -> Variable w s b -> Variable w s c -> T w s ()Source
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 (,)
.
Solution
solveDepthFirst :: C w => T w s a -> w (ST s) aSource
solveBreadthFirst :: C w => T w s a -> w (ST s) aSource