Commits (1)
......@@ -23,7 +23,7 @@ module FlatCurry.Types where
--- data type, function, and operator declarations
--- contained in this module, respectively.
data Prog = Prog String [String] [TypeDecl] [FuncDecl] [OpDecl]
deriving Eq
deriving (Eq,Show)
--- The data type for representing qualified names.
--- In FlatCurry all names are qualified to avoid name clashes.
......@@ -35,7 +35,7 @@ type QName = (String, String)
data Visibility
= Public -- public (exported) entity
| Private -- private entity
deriving (Eq, Show)
deriving (Eq,Show)
--- The data type for representing type variables.
--- They are represented by `(TVar i)` where `i` is a type variable index.
......@@ -62,12 +62,12 @@ type TVarIndex = Int
data TypeDecl
= Type QName Visibility [TVarIndex] [ConsDecl]
| TypeSyn QName Visibility [TVarIndex] TypeExpr
deriving Eq
deriving (Eq,Show)
--- 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]
deriving Eq
deriving (Eq,Show)
--- Data type for type expressions.
--- A type expression is either a type variable, a function type,
......@@ -87,7 +87,7 @@ data TypeExpr
--- An operator declaration `fix p n` in Curry corresponds to the
--- FlatCurry term `(Op n fix p)`.
data OpDecl = Op QName Fixity Int
deriving Eq
deriving (Eq,Show)
--- Data types for the different choices for the fixity of an operator.
data Fixity = InfixOp | InfixlOp | InfixrOp
......@@ -125,19 +125,19 @@ type Arity = Int
---
--- Thus, a function declaration consists of the name, arity, type, and rule.
data FuncDecl = Func QName Arity Visibility TypeExpr Rule
deriving Eq
deriving (Eq,Show)
--- A rule is either a list of formal parameters together with an expression
--- or an "External" tag.
data Rule
= Rule [VarIndex] Expr
| External String
deriving Eq
deriving (Eq,Show)
--- Data type for classifying case expressions.
--- Case expressions can be either flexible or rigid in Curry.
data CaseType = Rigid | Flex -- type of a case expression
deriving (Eq, Show)
deriving (Eq,Show)
--- Data type for classifying combinations
--- (i.e., a function/constructor applied to some arguments).
......@@ -150,7 +150,7 @@ data CaseType = Rigid | Flex -- type of a case expression
--- are provided) where the parameter is the number of
--- missing arguments
data CombType = FuncCall | ConsCall | FuncPartCall Arity | ConsPartCall Arity
deriving (Eq, Show)
deriving (Eq,Show)
--- Data type for representing expressions.
---
......@@ -206,7 +206,7 @@ data Expr
| Or Expr Expr
| Case CaseType Expr [BranchExpr]
| Typed Expr TypeExpr
deriving Eq
deriving (Eq,Show)
--- Data type for representing branches in a case expression.
---
......@@ -221,13 +221,13 @@ data Expr
--- for integers as branch patterns (similarly for other literals
--- like float or character constants).
data BranchExpr = Branch Pattern Expr
deriving Eq
deriving (Eq,Show)
--- Data type for representing patterns in case expressions.
data Pattern
= Pattern QName [VarIndex]
| LPattern Literal
deriving Eq
deriving (Eq,Show)
--- Data type for representing literals occurring in an expression
--- or case branch. It is either an integer, a float, or a character constant.
......@@ -235,7 +235,7 @@ data Literal
= Intc Int
| Floatc Float
| Charc Char
deriving (Eq, Show)
deriving (Eq,Ord,Show)
-----------------------------------------------------------------------
--- Translates a given qualified type name into external name relative to
......
......@@ -1405,7 +1405,7 @@ ConfigButton cmd confs = PlainButton (Command cmd : confs)
--- The argument contains the configuration options for the text edit widget.
TextEditScroll :: [ConfItem] -> Widget
TextEditScroll confs =
Matrix [] [[TextEdit ([WRef txtref, Fill]++confs),
matrix [[TextEdit ([WRef txtref, Fill]++confs),
ScrollV txtref [FillY]],
[ScrollH txtref [FillX]]] where txtref free
......@@ -1414,7 +1414,7 @@ TextEditScroll confs =
--- The argument contains the configuration options for the list box widget.
ListBoxScroll :: [ConfItem] -> Widget
ListBoxScroll confs =
Matrix [] [[ListBox ([WRef lbref, Fill]++confs),
matrix [[ListBox ([WRef lbref, Fill]++confs),
ScrollV lbref [FillY]],
[ScrollH lbref [FillX]]] where lbref free
......@@ -1423,9 +1423,9 @@ ListBoxScroll confs =
--- The argument contains the configuration options for the text edit widget.
CanvasScroll :: [ConfItem] -> Widget
CanvasScroll confs =
Col []
[Row [] [Canvas ([WRef cref, Fill]++confs),
ScrollV cref [FillY]],
col
[row [Canvas ([WRef cref, Fill]++confs),
ScrollV cref [FillY]],
ScrollH cref [FillX]] where cref free
......@@ -1433,7 +1433,7 @@ CanvasScroll confs =
--- The argument contains the configuration options for the entry widget.
EntryScroll :: [ConfItem] -> Widget
EntryScroll confs =
Col []
col
[Entry ([WRef entryref, FillX]++confs),
ScrollH entryref [Width 10, FillX]]
where entryref free
......