1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
module FlatCurry.Annotated.Types
( module FlatCurry.Annotated.Types
, module FlatCurry.Types
) where
import FlatCurry.Types ( QName, VarIndex, Visibility (..), TVarIndex, TVarWithKind
, TypeDecl (..), Kind(..), OpDecl (..), Fixity (..)
, TypeExpr (..), ConsDecl (..), NewConsDecl (..)
, Literal (..), CombType (..), CaseType (..)
)
data AProg a = AProg String [String] [TypeDecl] [AFuncDecl a] [OpDecl]
deriving (Eq, Ord, Read, Show)
type Arity = Int
data AFuncDecl a = AFunc QName Arity Visibility TypeExpr (ARule a)
deriving (Eq, Ord, Read, Show)
data ARule a
= ARule a [(VarIndex, a)] (AExpr a)
| AExternal a String
deriving (Eq, Ord, Read, Show)
data AExpr a
= AVar a VarIndex
| ALit a Literal
| AComb a CombType (QName, a) [AExpr a]
| ALet a [((VarIndex, a), AExpr a)] (AExpr a)
| AFree a [(VarIndex, a)] (AExpr a)
| AOr a (AExpr a) (AExpr a)
| ACase a CaseType (AExpr a) [ABranchExpr a]
| ATyped a (AExpr a) TypeExpr
deriving (Eq, Ord, Read, Show)
data ABranchExpr a = ABranch (APattern a) (AExpr a)
deriving (Eq, Ord, Read, Show)
data APattern a
= APattern a (QName, a) [(VarIndex, a)]
| ALPattern a Literal
deriving (Eq, Ord, Read, Show)
|