diff options
author | Tom Smeding <tom@tomsmeding.com> | 2024-02-13 22:51:57 +0100 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2024-02-13 22:51:57 +0100 |
commit | 3ef786673ff8298124cd3b5ef50c35dbb23f77e2 (patch) | |
tree | e7c0cb4ac969dff2b8f2030f76df4bf0723294b1 /AST.hs | |
parent | f8ef28316dd8adeaf8d4d3e0f6e310e26ac19028 (diff) |
Parse basic ADTs, and fix bugs
Diffstat (limited to 'AST.hs')
-rw-r--r-- | AST.hs | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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)) |