zabt-0.4.0.0: Simple-minded abstract binding trees

Safe HaskellSafe
LanguageHaskell2010

Zabt.Freshen

Synopsis

Documentation

class Eq v => Freshen v where Source #

A type which can be freshened has an operation which attempts to find a unique version of its input. The principal thing that must hold is that `freshen n /= n`. It's not necessary that `freshen n` be totally fresh with respect to a context---that's too much to ask of a value---but it is necessary that freshen *eventually* produces a fresh value.

Variable identifier types must be instances of Freshen.

Minimal complete definition

freshen

Methods

freshen :: v -> v Source #

freshenUntil :: Freshen v => (v -> Bool) -> v -> v Source #

Freshen a variable until it can pass a given predicate.

freshWrt :: (Ord v, Freshen v) => Set v -> v -> v Source #

Freshen a variable with respect to a set of variables. Or, freshen a variable until it's unique with respect to a set.