aboutsummaryrefslogtreecommitdiff
path: root/src/Language/Mili/Compiler.hs
diff options
context:
space:
mode:
authorMarvin Borner2024-11-27 16:18:16 +0100
committerMarvin Borner2024-11-27 16:18:16 +0100
commit02ff39d0ab6488fa8cedb31030130b352e10b3e2 (patch)
tree2fef90f83699831d13dea768e144430e1f60a7a2 /src/Language/Mili/Compiler.hs
parent91d52159a5ac32165dca0edfaf75a19845156551 (diff)
Initial typingHEADmain
Diffstat (limited to 'src/Language/Mili/Compiler.hs')
-rw-r--r--src/Language/Mili/Compiler.hs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Language/Mili/Compiler.hs b/src/Language/Mili/Compiler.hs
new file mode 100644
index 0000000..ab23767
--- /dev/null
+++ b/src/Language/Mili/Compiler.hs
@@ -0,0 +1,19 @@
+-- MIT License, Copyright (c) 2024 Marvin Borner
+
+module Language.Mili.Compiler
+ ( compile
+ ) where
+
+import Data.Mili ( Nat(..)
+ , Term(..)
+ , shift
+ )
+
+data Comp = CAbs String Comp -- | Abstraction with pointer
+ | CApp Comp Comp -- | Application
+ | CVar -- | Namless variable
+ | CNum Nat -- | Peano numeral
+ | CRec Comp Comp Comp Comp Comp -- | Unbounded iteration
+
+compile :: Term -> Comp
+compile t = CVar