aboutsummaryrefslogtreecommitdiff
path: root/src/Language/Mili/Compiler.hs
diff options
context:
space:
mode:
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