compdata-0.5.2: Compositional Data Types

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

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 aSource

Run the given computation with the next available name.

nameCoerce :: Name i -> Name jSource

Change the type tag of a name.

evalFreshM :: FreshM a -> aSource

Evaluate a computation that uses fresh names.