unification-fd-0.8.0: Simple generic unification algorithms.

Portabilitysemi-portable (MPTCs,...)
Stabilityhighly experimental
Maintainerwren@community.haskell.org
Safe HaskellSafe-Infered

Control.Unification.Ranked.IntVar

Description

A ranked variant of Control.Unification.IntVar.

Synopsis

Documentation

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.

Constructors

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