From 02ff39d0ab6488fa8cedb31030130b352e10b3e2 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 27 Nov 2024 16:18:16 +0100 Subject: Initial typing --- src/Language/Mili/Compiler.hs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/Language/Mili/Compiler.hs (limited to 'src/Language/Mili/Compiler.hs') 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 -- cgit v1.2.3