unification-fd-0.5.0: Simple generic unification algorithms.

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

Control.Unification.STVar

Description

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

Synopsis

Documentation

data STVar s a 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

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.