| WashNGo-2.12: WASH is a family of embedded domain specific languages (EDSL) for programming Web applications in Haskell. | Contents | Index |
|
|
|
Description |
The Types module aims at providing a representation for (first-order)
monomorphic Haskell types. Two type representations are equal if and
only if the represented types have identical definitions. Thus a type
representation consists of a type term and the smallest list of all
(data or newtype) definitions needed either in the type term or in
another definition. The list of definitions is sorted to make
representations unique.
The main use of type representations is to provide a type index for
storing Haskell values externally and for reading them back into a
running program without sacrificing type safety. Just reading them
back with the Read class is not sufficient because
- Read does not distinguish between Int and Integer, Float and Doubley
- Read cannot avoid accidental matches of constructor names
Meanwhile, the Typeable class of GHC provides an encoding with similar
goals.
|
|
Synopsis |
|
|
|
Documentation |
|
data TySpec |
A type specification consists of a type representation TyRep and a list of
type declarations.
| Constructors | | Instances | |
|
|
data TyRep |
A type representation is built from base types, type variables, tuples, and
references to data-defined types.
| Constructors | | Instances | |
|
|
data TyDecl |
A data declaration consists of the name of the data type, a list of type
variables, and a list of constructor representations.
| Constructors | | Instances | |
|
|
data ConRep |
A constructor is represented by its name, a list of field names (if defined
using record notation), and the list of its argument types
| Constructors | | Instances | |
|
|
class Types a where |
| Methods | | | Instances | Types Bool | Types Char | Types Double | Types Float | Types Int | Types Integer | Types () | (Types a, Types b) => Types (a, b) | (Types a, Types b, Types c) => Types (a, b, c) | (Types a, Types b, Types c, Types d) => Types (a, b, c, d) | (Types a, Types b, Types c, Types d, Types e) => Types (a, b, c, d, e) | Types a => Types (Maybe a) | Types a => Types [a] | (Types a, Types b) => Types (Either a b) |
|
|
|
listDef :: TyDecl |
|
maybeDef :: TyDecl |
|
eitherDef :: TyDecl |
|
merge :: [TyDecl] -> [TyDecl] -> [TyDecl] |
|
merges :: [[TyDecl]] -> [TyDecl] |
|
class TID a where |
| Methods | | | Instances | |
|
|
Produced by Haddock version 0.8 |