compdata-param-0.9.2: Parametric 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.Param.Multi.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
Monad FreshM Source # 
Instance details

Defined in Data.Comp.Param.Multi.FreshM

Methods

(>>=) :: FreshM a -> (a -> FreshM b) -> FreshM b #

(>>) :: FreshM a -> FreshM b -> FreshM b #

return :: a -> FreshM a #

fail :: String -> FreshM a #

Functor FreshM Source # 
Instance details

Defined in Data.Comp.Param.Multi.FreshM

Methods

fmap :: (a -> b) -> FreshM a -> FreshM b #

(<$) :: a -> FreshM b -> FreshM a #

Applicative FreshM Source # 
Instance details

Defined in Data.Comp.Param.Multi.FreshM

Methods

pure :: a -> FreshM a #

(<*>) :: FreshM (a -> b) -> FreshM a -> FreshM b #

liftA2 :: (a -> b -> c) -> FreshM a -> FreshM b -> FreshM c #

(*>) :: FreshM a -> FreshM b -> FreshM b #

(<*) :: FreshM a -> FreshM b -> FreshM a #

data Name i Source #

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

Instances
PEq Name Source # 
Instance details

Defined in Data.Comp.Param.Multi.Equality

Methods

peq :: Name i -> Name j -> FreshM Bool Source #

POrd Name Source # 
Instance details

Defined in Data.Comp.Param.Multi.Ordering

Methods

pcompare :: Name i -> Name j -> FreshM Ordering Source #

Eq (Name i) Source # 
Instance details

Defined in Data.Comp.Param.Multi.FreshM

Methods

(==) :: Name i -> Name i -> Bool #

(/=) :: Name i -> Name i -> Bool #

Ord (Name i) Source # 
Instance details

Defined in Data.Comp.Param.Multi.FreshM

Methods

compare :: Name i -> Name i -> Ordering #

(<) :: Name i -> Name i -> Bool #

(<=) :: Name i -> Name i -> Bool #

(>) :: Name i -> Name i -> Bool #

(>=) :: Name i -> Name i -> Bool #

max :: Name i -> Name i -> Name i #

min :: Name i -> Name i -> Name i #

Show (Name i) Source # 
Instance details

Defined in Data.Comp.Param.Multi.FreshM

Methods

showsPrec :: Int -> Name i -> ShowS #

show :: Name i -> String #

showList :: [Name i] -> ShowS #

(EqHD f, PEq a) => PEq (Cxt h f Name a) Source # 
Instance details

Defined in Data.Comp.Param.Multi.Equality

Methods

peq :: Cxt h f Name a i -> Cxt h f Name a j -> FreshM Bool Source #

(OrdHD f, POrd a) => POrd (Cxt h f Name a) Source # 
Instance details

Defined in Data.Comp.Param.Multi.Ordering

Methods

pcompare :: Cxt h f Name a i -> Cxt h f Name a j -> FreshM Ordering Source #

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.