Copyright | (c) 2002 - 2004 Wolfgang Lux Martin Engelke 2015 Jan Tikovsky |
---|---|
License | BSD-3-clause |
Maintainer | bjp@informatik.uni-kiel.de |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Base.Types
Contents
Description
This module modules provides the definitions for the internal representation of types in the compiler.
- data Type
- isArrowType :: Type -> Bool
- arrowArity :: Type -> Int
- arrowArgs :: Type -> [Type]
- arrowBase :: Type -> Type
- arrowUnapply :: Type -> ([Type], Type)
- typeVars :: Type -> [Int]
- typeConstrs :: Type -> [QualIdent]
- typeSkolems :: Type -> [Int]
- equTypes :: Type -> Type -> Bool
- qualifyType :: ModuleIdent -> Type -> Type
- unqualifyType :: ModuleIdent -> Type -> Type
- data DataConstr
- = DataConstr Ident Int [Type]
- | RecordConstr Ident Int [Ident] [Type]
- constrIdent :: DataConstr -> Ident
- constrTypes :: DataConstr -> [Type]
- recLabels :: DataConstr -> [Ident]
- recLabelTypes :: DataConstr -> [Type]
- tupleData :: [DataConstr]
- data TypeScheme = ForAll Int Type
- data ExistTypeScheme = ForAllExist Int Int Type
- monoType :: Type -> TypeScheme
- polyType :: Type -> TypeScheme
- unitType :: Type
- boolType :: Type
- charType :: Type
- intType :: Type
- floatType :: Type
- stringType :: Type
- listType :: Type -> Type
- ioType :: Type -> Type
- tupleType :: [Type] -> Type
- typeVar :: Int -> Type
- predefTypes :: [(Type, [DataConstr])]
Representation of Types
Constructors
TypeVariable Int | |
TypeConstructor QualIdent [Type] | |
TypeArrow Type Type | |
TypeConstrained [Type] Int | |
TypeSkolem Int |
isArrowType :: Type -> Bool Source #
arrowArity :: Type -> Int Source #
typeConstrs :: Type -> [QualIdent] Source #
typeSkolems :: Type -> [Int] Source #
qualifyType :: ModuleIdent -> Type -> Type Source #
unqualifyType :: ModuleIdent -> Type -> Type Source #
Representation of Data Constructors
data DataConstr Source #
Constructors
DataConstr Ident Int [Type] | |
RecordConstr Ident Int [Ident] [Type] |
Instances
constrIdent :: DataConstr -> Ident Source #
constrTypes :: DataConstr -> [Type] Source #
recLabels :: DataConstr -> [Ident] Source #
recLabelTypes :: DataConstr -> [Type] Source #
tupleData :: [DataConstr] Source #
Representation of Quantification
data TypeScheme Source #
Instances
monoType :: Type -> TypeScheme Source #
polyType :: Type -> TypeScheme Source #
Predefined types
stringType :: Type Source #
predefTypes :: [(Type, [DataConstr])] Source #