From 5a3007ea91a3ee57a4fc3e34c0edd59a90b525c3 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Mon, 27 Nov 2023 19:00:20 +0100 Subject: WIP on code generation for case expressions --- snug-clean/src/Snug/Syntax.dcl | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'snug-clean/src/Snug/Syntax.dcl') diff --git a/snug-clean/src/Snug/Syntax.dcl b/snug-clean/src/Snug/Syntax.dcl index 5246dcd..f6ff0f2 100644 --- a/snug-clean/src/Snug/Syntax.dcl +++ b/snug-clean/src/Snug/Syntax.dcl @@ -1,5 +1,7 @@ definition module Snug.Syntax +from Data.Set import :: Set + :: TypeIdent :== String :: TypeVarIdent :== String :: ConstructorIdent :== String @@ -38,3 +40,8 @@ definition module Snug.Syntax | TypeDef !TypeIdent !Type | FunDef !SymbolIdent ![(SymbolIdent, Type)] !Type !Expression | TestDef !String !Type !Expression !String + +class usedSymbols a :: !a -> Set SymbolIdent +instance usedSymbols [a] | usedSymbols a +instance usedSymbols (a, b) | usedSymbols a & usedSymbols b +instance usedSymbols CaseAlternative, Expression, Pattern -- cgit v1.2.3