mad-props-0.1.0.0: Monadic DSL for building constraint solvers using basic propagators.

Safe HaskellNone
LanguageHaskell2010

Props.Internal.Links

Synopsis

Documentation

disjoint :: forall a m. (Monad m, Typeable a, Ord a) => PVar (Set a) -> PVar (Set a) -> PropT m () Source #

Apply the constraint that two variables may NOT be set to the same value. This constraint is bidirectional.

E.g. you might apply this constraint to two cells in the same row of sudoku grid to assert they don't contain the same value.

equal :: forall a m. (Monad m, Typeable a, Ord a) => PVar (Set a) -> PVar (Set a) -> PropT m () Source #

Apply the constraint that two variables MUST be set to the same value. This constraint is bidirectional.

require :: (Monad m, Typeable a, Ord a, Typeable b) => (a -> b -> Bool) -> PVar (Set a) -> PVar (Set b) -> PropT m () Source #

Given a choice for a; filter for valid options of b using the given predicate.

E.g. if a must always be greater than b, you could require:

require (>) a b