compdata-0.3: Compositional Data Types

Portabilitynon-portable (GHC Extensions)
Stabilityexperimental
MaintainerTom Hvitved <hvitved@diku.dk>

Data.Comp.Param.FreshM

Description

This module defines a monad for generating fresh, abstract variables, useful e.g. for defining equality on terms.

Synopsis

Documentation

data FreshM a Source

Monad for generating fresh (abstract) variables.

Instances

data Var Source

Abstract notion of a variable (the constructor is hidden).

Instances

Eq Var 
Ord Var 
Show Var 
(EqD f, PEq a) => PEq (Cxt h f Var a) 
(OrdD f, POrd a) => POrd (Cxt h f Var a) 
(ShowD f, PShow a) => PShow (Cxt h f Var a) 

genVar :: FreshM VarSource

Generate a fresh variable.

evalFreshM :: FreshM a -> aSource

Evaluate a computation that uses fresh variables.