unification-fd-0.9.0: Simple generic unification algorithms.

Portabilitysemi-portable (Rank2Types, MPTCs,...)
Stabilityexperimental
Maintainerwren@community.haskell.org
Safe HaskellNone

Control.Unification.STVar

Description

This module defines an implementation of unification variables using the ST monad.

Synopsis

Documentation

data STVar s t Source

Unification variables implemented by STRefs. In addition to the STRef for the term itself, we also track the variable's ID (to support visited-sets).

Instances

Unifiable t => BindingMonad t (STVar s t) (STBinding s) 
Eq (STVar s t) 
Show (STVar s t) 
Variable (STVar s t) 

data STBinding s a Source

A monad for handling STVar bindings.

runSTBinding :: (forall s. STBinding s a) -> aSource

Run the ST ranked binding monad. N.B., because STVar are rank-2 quantified, this guarantees that the return value has no such references. However, in order to remove the references from terms, you'll need to explicitly apply the bindings and ground the term.