unification-fd-0.9.0: Simple generic unification algorithms.

CopyrightCopyright (c) 2007--2014 wren gayle romano
LicenseBSD
Maintainerwren@community.haskell.org
Stabilityhighly experimental
Portabilitysemi-portable (MPTCs,...)
Safe HaskellNone
LanguageHaskell98

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 a Source

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