compdata-0.7.0.2: Compositional Data Types

Copyright(c) 2011 Patrick Bahr, Tom Hvitved
LicenseBSD3
MaintainerTom Hvitved <hvitved@diku.dk>
Stabilityexperimental
Portabilitynon-portable (GHC Extensions)
Safe HaskellNone
LanguageHaskell98

Data.Comp.MultiParam.FreshM

Description

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

Synopsis

Documentation

data FreshM a Source

Monad for generating fresh (abstract) names.

Instances

data Name i Source

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

Instances

PEq Name 
POrd Name 
Eq (Name i) 
Ord (Name i) 
Show (Name i) 
(EqHD f, PEq a) => PEq (Cxt h f Name a) 
(OrdHD f, POrd a) => POrd (Cxt h f Name a) 

withName :: (Name i -> FreshM a) -> FreshM a Source

Run the given computation with the next available name.

nameCoerce :: Name i -> Name j Source

Change the type tag of a name.

evalFreshM :: FreshM a -> a Source

Evaluate a computation that uses fresh names.