Commit 0cd6165f authored by Michael Hanus's avatar Michael Hanus
Browse files

Some instance declarations added

parent 4cbc2d4a
......@@ -80,6 +80,9 @@ data CTypeDecl
| CTypeSyn QName CVisibility [CTVarIName] CTypeExpr
| CNewType QName CVisibility [CTVarIName] CConsDecl
instance Eq CTypeDecl where
_ == _ = error "TODO: Eq AbstractCurry.Types.CTypeDecl"
--- The type for representing type variables.
--- They are represented by (i,n) where i is a type variable index
--- which is unique inside a function and n is a name (if possible,
......@@ -97,6 +100,9 @@ data CConsDecl
--- the label, the visibility and its corresponding type.
data CFieldDecl = CField QName CVisibility CTypeExpr
instance Eq CFieldDecl where
_ == _ = error "TODO: Eq AbstractCurry.Types.CFieldDecl"
--- Type expression.
--- A type expression is either a type variable, a function type,
--- or a type constructor application.
......@@ -114,6 +120,9 @@ data CTypeExpr
instance Eq CTypeExpr where
_ == _ = error "TODO: Eq AbstractCurry.Types.CTypeExpr"
instance Show CTypeExpr where
show _ = error "TODO: Show AbstractCurry.Types.CTypeExpr"
--- Labeled record fields
type CField a = (QName, a)
......@@ -172,6 +181,9 @@ data CLocalDecl
| CLocalPat CPattern CRhs -- local pattern declaration
| CLocalVars [CVarIName] -- local free variable declaration
instance Eq CLocalDecl where
_ == _ = error "TODO: Eq AbstractCurry.Types.CLocalDecl"
--- Data types for representing object variables.
--- Object variables occurring in expressions are represented by (Var i)
--- where i is a variable index.
......@@ -215,6 +227,9 @@ data CLiteral
| CCharc Char
| CStringc String
instance Eq CLiteral where
_ == _ = error "TODO: Eq AbstractCurry.Types.CLiteral"
--- Data type for representing statements in do expressions and
--- list comprehensions.
data CStatement
......
......@@ -23,6 +23,9 @@ import Time
--- Data type to represent entity/relationship diagrams.
data ERD = ERD ERDName [Entity] [Relationship]
instance Show ERD where
show _ = error "TODO: Show Database.ERD.ERD"
type ERDName = String -- used as the name of the generated module
......@@ -41,6 +44,12 @@ data Key = NoKey
| PKey
| Unique
instance Eq Key where
_ == _ = error "TODO: Eq Database.ERD.Key"
instance Show Key where
show _ = error "TODO: Show Database.ERD.Key"
type Null = Bool
data Domain = IntDom (Maybe Int)
......
......@@ -24,6 +24,9 @@ module FlatCurry.Types where
--- contained in this module, respectively.
data Prog = Prog String [String] [TypeDecl] [FuncDecl] [OpDecl]
instance Eq Prog where
_ == _ = error "TODO: Eq FlatCurry.Types.Prog"
--- The data type for representing qualified names.
--- In FlatCurry all names are qualified to avoid name clashes.
--- The first component is the module name and the second component the
......@@ -68,6 +71,9 @@ data TypeDecl
= Type QName Visibility [TVarIndex] [ConsDecl]
| TypeSyn QName Visibility [TVarIndex] TypeExpr
instance Eq TypeDecl where
_ == _ = error "TODO: Eq FlatCurry.Types.TypeDecl"
--- A constructor declaration consists of the name and arity of the
--- constructor and a list of the argument types of the constructor.
data ConsDecl = Cons QName Int Visibility [TypeExpr]
......@@ -169,6 +175,12 @@ instance Eq CaseType where
--- missing arguments
data CombType = FuncCall | ConsCall | FuncPartCall Arity | ConsPartCall Arity
instance Eq CombType where
FuncCall == x = case x of { FuncCall -> True ; _ -> False }
ConsCall == x = case x of { ConsCall -> True ; _ -> False }
FuncPartCall i == x = case x of { FuncPartCall j -> i==j ; _ -> False }
ConsPartCall i == x = case x of { ConsPartCall j -> i==j ; _ -> False }
--- Data type for representing expressions.
---
--- Remarks:
......@@ -224,6 +236,9 @@ data Expr
| Case CaseType Expr [BranchExpr]
| Typed Expr TypeExpr
instance Eq Expr where
_ == _ = error "TODO: Eq FlatCurry.Types.Expr"
--- Data type for representing branches in a case expression.
---
--- Branches "(m.c x1...xn) -> e" in case expressions are represented as
......@@ -238,6 +253,9 @@ data Expr
--- like float or character constants).
data BranchExpr = Branch Pattern Expr
instance Eq BranchExpr where
_ == _ = error "TODO: Eq FlatCurry.Types.BranchExpr"
--- Data type for representing patterns in case expressions.
data Pattern
= Pattern QName [VarIndex]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment