From 63fef958a78f5abb21c917358783398e65dbe060 Mon Sep 17 00:00:00 2001 From: sebastianselander Date: Fri, 5 May 2023 14:09:54 +0200 Subject: [PATCH] Improved prelude --- src/Main.hs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Main.hs b/src/Main.hs index 6088a7c..b70a80c 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -178,12 +178,13 @@ prelude :: String prelude = unlines [ "\n" - , -- , "customHelperFunctionCuzPoorImplementation : Bool () -> Int -> Bool ()" - -- , "customHelperFunctionCuzPoorImplementation x y = x" - "data Bool where" + , "data Bool where" , " False : Bool" , " True : Bool" - , "lt : Int -> Int -> Bool" - , "lt x y = True" + , -- The function body of lt is replaced during code gen. It exists here for type checking purposes. + "lt : Int -> Int -> Bool" + , "lt x y = case x of" + , " _ => True" + , " _ => False" , "\n" ]