From 3ef786673ff8298124cd3b5ef50c35dbb23f77e2 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Tue, 13 Feb 2024 22:51:57 +0100 Subject: Parse basic ADTs, and fix bugs --- AST.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'AST.hs') 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)) -- cgit v1.2.3-70-g09d2