unification-fd-0.9.0: Simple generic unification algorithms.

Portabilitysemi-portable (MPTCs,...)
Stabilityhighly experimental
Safe HaskellNone



A ranked variant of Control.Unification.IntVar.



newtype IntVar Source

A "mutable" unification variable implemented by an integer. This provides an entirely pure alternative to truly mutable alternatives (like STVar), which can make backtracking easier.

N.B., because this implementation is pure, we can use it for both ranked and unranked monads.


IntVar Int 

data IntRBindingState t Source

Ranked binding state for IntVar.

data IntRBindingT t m a Source

A monad for storing IntVar bindings, implemented as a StateT. For a plain state monad, set m = Identity; for a backtracking state monad, set m = Logic.

evalIntRBindingT :: Monad m => IntRBindingT t m a -> m aSource

N.B., you should explicitly apply bindings before calling this function, or else the bindings will be lost