Copyright | (c) 2002 - 2004 Wolfgang Lux 2011 Björn Peemöller |
---|---|
License | BSD-3-clause |
Maintainer | bjp@informatik.uni-kiel.de |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Env.TypeConstructor
Description
For all defined types the compiler must maintain kind information. At present, Curry does not support type classes. Therefore its type language is first order and the only information that must be recorded is the arity of each type. For algebraic data types and renaming types the compiler also records all data constructors belonging to that type, for alias types the type expression to be expanded is saved. In order to manage the import and export of types, the names of the original definitions are also recorded. On import two types are considered equal if their original names match.
The information for a data constructor comprises the number of existentially quantified type variables and the list of the argument types. Note that renaming type constructors have only one type argument.
Importing and exporting algebraic data types and renaming types is complicated by the fact that the constructors of the type may be (partially) hidden in the interface. This facilitates the definition of abstract data types. An abstract type is always represented as a data type without constructors in the interface regardless of whether it is defined as a data type or as a renaming type. When only some constructors of a data type are hidden, those constructors are replaced by underscores in the interface. Furthermore, if the right-most constructors of a data type are hidden, they are not exported at all in order to make the interface more stable against changes which are private to the module.
Documentation
Constructors
DataType QualIdent Int [DataConstr] | |
RenamingType QualIdent Int DataConstr | |
AliasType QualIdent Int Type |
bindTypeInfo :: (QualIdent -> Int -> a -> TypeInfo) -> ModuleIdent -> Ident -> [Ident] -> a -> TCEnv -> TCEnv Source #
qualLookupTC :: QualIdent -> TCEnv -> [TypeInfo] Source #
qualLookupTCUnique :: ModuleIdent -> QualIdent -> TCEnv -> [TypeInfo] Source #