Copyright | (c) 2014, Aleksey Kliger |
---|---|
License | BSD3 (See LICENSE) |
Maintainer | Aleksey Kliger |
Stability | experimental |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Names stand for values. They may be bound or free.
Names over terms
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.
isFreeName :: Name a -> Bool Source
Returns True
iff the given Name a
is free.
Name construction
string2Name :: String -> Name a Source
Make a free 'Name a' from a String
s2n :: String -> Name a Source
Synonym for string2Name
.
Name inspection
name2String :: Name a -> String Source
Get the string part of a Name
.
name2Integer :: Name a -> Integer Source
Get the integer part of a Name
.