aboutsummaryrefslogtreecommitdiff
path: root/AST.hs
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2024-02-13 22:51:57 +0100
committerTom Smeding <tom@tomsmeding.com>2024-02-13 22:51:57 +0100
commit3ef786673ff8298124cd3b5ef50c35dbb23f77e2 (patch)
treee7c0cb4ac969dff2b8f2030f76df4bf0723294b1 /AST.hs
parentf8ef28316dd8adeaf8d4d3e0f6e310e26ac19028 (diff)
Parse basic ADTs, and fix bugs
Diffstat (limited to 'AST.hs')
-rw-r--r--AST.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/AST.hs b/AST.hs
index 2e1bb13..47652b6 100644
--- a/AST.hs
+++ b/AST.hs
@@ -6,7 +6,10 @@ import Data.List.NonEmpty (NonEmpty)
newtype Name = Name String
deriving (Show, Eq)
-data Program t = Program [FunDef t]
+data Program t = Program [DataDef] [FunDef t]
+ deriving (Show)
+
+data DataDef = DataDef Name [Name] [(Name, [Type])]
deriving (Show)
data FunDef t = FunDef Name (Maybe Type) (NonEmpty (FunEq t))