Definition of data types to represent interfaces of Curry modules.
These definitions are adapted from the Haskell definition contained
in the implementation of the Curry front end, see
https://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/blob/master/src/Curry/Syntax/Type.hs
Version: September 2024
Interface declarations are restricted to type declarations and signatures. Note that an interface function declaration additionaly contains the function arity (= number of parameters) in order to generate correct FlatCurry function applications.
Constructors:
Interface
:: ModuleIdent -> [IImportDecl] -> [IDecl] -> Interface
Interface import declaration
Constructors:
IImportDecl
:: ModuleIdent -> IImportDecl
Arity of a function
Type synonym: Arity = Int
Operator precedence
Type synonym: Precedence = Int
Constructors:
InfixL
:: Infix
InfixR
:: Infix
Infix
:: Infix
Interface declaration
Constructors:
IInfixDecl
:: Infix -> Precedence -> QualIdent -> IDecl
HidingDataDecl
:: QualIdent -> (Maybe KindExpr) -> [Ident] -> IDecl
IDataDecl
:: QualIdent -> (Maybe KindExpr) -> [Ident] -> [ConstrDecl] -> [Ident] -> IDecl
INewtypeDecl
:: QualIdent -> (Maybe KindExpr) -> [Ident] -> NewConstrDecl -> [Ident] -> IDecl
ITypeDecl
:: QualIdent -> (Maybe KindExpr) -> [Ident] -> TypeExpr -> IDecl
IFunctionDecl
:: QualIdent -> (Maybe Ident) -> Arity -> QualTypeExpr -> IDecl
HidingClassDecl
:: Context -> QualIdent -> (Maybe KindExpr) -> [Ident] -> [FunDep] -> IDecl
IClassDecl
:: Context -> QualIdent -> (Maybe KindExpr) -> [Ident] -> [FunDep] -> [IMethodDecl] -> [Ident] -> IDecl
IInstanceDecl
:: Context -> QualIdent -> InstanceType -> [IMethodImpl] -> (Maybe ModuleIdent) -> IDecl
Class methods
Constructors:
IMethodDecl
:: Ident -> (Maybe Arity) -> QualTypeExpr -> IMethodDecl
Class method implementations
Type synonym: IMethodImpl = (Ident,Arity)
Kind expressions
Constructors:
Constructors:
Ident
:: String -> Ident
Fields:
idName
:: String
Constructors:
ModuleIdent
:: [String] -> ModuleIdent
Fields:
midQualifiers
:: [String]
Constructors:
QualIdent
:: (Maybe ModuleIdent) -> Ident -> QualIdent
Fields:
qidModule
:: (Maybe ModuleIdent)
qidIdent
:: Ident
Constructors:
ConstrDecl
:: Ident -> [TypeExpr] -> ConstrDecl
ConOpDecl
:: TypeExpr -> Ident -> TypeExpr -> ConstrDecl
RecordDecl
:: Ident -> [FieldDecl] -> ConstrDecl
Constructors:
NewConstrDecl
:: Ident -> TypeExpr -> NewConstrDecl
NewRecordDecl
:: Ident -> (Ident,TypeExpr) -> NewConstrDecl
Constructors:
Constructors:
ConstructorType
:: QualIdent -> TypeExpr
ApplyType
:: TypeExpr -> TypeExpr -> TypeExpr
VariableType
:: Ident -> TypeExpr
TupleType
:: [TypeExpr] -> TypeExpr
ListType
:: [TypeExpr] -> TypeExpr
ArrowType
:: TypeExpr -> TypeExpr -> TypeExpr
ParenType
:: TypeExpr -> TypeExpr
ForallType
:: [Ident] -> TypeExpr -> TypeExpr
Constructors:
Type synonym: Context = [Constraint]
Constructors:
Type synonym: InstanceType = [TypeExpr]
Constructors: