unbound-generics-0.1: Reimplementation of Unbound using GHC Generics

MaintainerAleksey Kliger
Safe HaskellSafe-Inferred




Names stand for values. They may be bound or free.


Names over terms

data Name a Source

An abstract datatype of names Name a that stand for terms of type a. The type a is used as a tag to distinguish these names from names that may stand for other sorts of terms.

Two names in a term are consider aeq equal when they are the same name (in the sense of '(==)'). In patterns, however, any two names are equal if they occur in the same place within the pattern. This induces alpha equivalence on terms in general.

Names may either be free or bound (see isFreeName). Free names may be extracted from patterns using isPat. Bound names cannot be.


Fn String !Integer 
Bn !Integer !Integer 


Typeable1 Name 
Generic a => Subst b (Name a) 
Eq (Name a) 
Ord (Name a) 
Show (Name a) 
Generic (Name a) 
Typeable a => Alpha (Name a) 

isFreeName :: Name a -> BoolSource

Returns True iff the given Name a is free.

Name construction

string2Name :: String -> Name aSource

Make a free 'Name a' from a String

s2n :: String -> Name aSource

Synonym for string2Name.

makeName :: String -> Integer -> Name aSource

Make a name from a String and an Integer index

Name inspection

name2String :: Name a -> StringSource

Get the string part of a Name.

name2Integer :: Name a -> IntegerSource

Get the integer part of a Name.

Heterogeneous names

data AnyName whereSource

An AnyName is a name that stands for a term of some (existentially hidden) type.


AnyName :: Typeable a => Name a -> AnyName