aboutsummaryrefslogtreecommitdiff
path: root/snug-clean/src/Snug/Compile/Typing.icl
diff options
context:
space:
mode:
authorCamil Staps2023-11-27 19:00:20 +0100
committerCamil Staps2023-11-27 19:00:20 +0100
commit5a3007ea91a3ee57a4fc3e34c0edd59a90b525c3 (patch)
tree3addc1233eb1e80657fa36b6599e3ebe3d097d88 /snug-clean/src/Snug/Compile/Typing.icl
parentUpdate to base 2.0 (diff)
WIP on code generation for case expressions
Diffstat (limited to 'snug-clean/src/Snug/Compile/Typing.icl')
-rw-r--r--snug-clean/src/Snug/Compile/Typing.icl14
1 files changed, 14 insertions, 0 deletions
diff --git a/snug-clean/src/Snug/Compile/Typing.icl b/snug-clean/src/Snug/Compile/Typing.icl
new file mode 100644
index 0000000..5587da7
--- /dev/null
+++ b/snug-clean/src/Snug/Compile/Typing.icl
@@ -0,0 +1,14 @@
+implementation module Snug.Compile.Typing
+
+import Data.Error
+
+import Snug.Syntax
+
+instance type Expression
+where
+ type locals e = case e of
+ BasicValue bv -> type locals bv
+ Symbol sym -> // TODO
+ Constructor cons -> // TODO
+ Case _ alts -> checkSameTypes "case alternatives" [type locals e \\ CaseAlternative _ e <- alts]
+ ExpApp e1 e2 -> // TODO