shithub: MicroHs

Download patch

ref: 218649cdec8461e5f13060c8359665365a51de44
parent: aeae7c4f920038bfc9474560d7956505d1710fa7
author: Lennart Augustsson <lennart.augustsson@epicgames.com>
date: Mon Dec 4 13:35:10 EST 2023

Swap encIf arguments

--- a/src/MicroHs/Desugar.hs
+++ b/src/MicroHs/Desugar.hs
@@ -198,7 +198,7 @@
     ECase e as -> dsCase (getSLoc aexpr) e as
     ELet ads e -> dsBinds ads (dsExpr e)
     ETuple es -> Lam (mkIdent "$f") $ foldl App (Var $ mkIdent "$f") $ map dsExpr es
-    EIf e1 e2 e3 -> encIf (dsExpr e1) (dsExpr e3) (dsExpr e2)
+    EIf e1 e2 e3 -> encIf (dsExpr e1) (dsExpr e2) (dsExpr e3)
     EListish (LList es) -> encList $ map dsExpr es
     EListish (LCompr e astmts) ->
       case astmts of
--- a/src/MicroHs/EncodeData.hs
+++ b/src/MicroHs/EncodeData.hs
@@ -56,7 +56,7 @@
   in lams xs $ strict ss xs $ lams fs $ apps (Var f) (map Var xs)  
 
 encIfScott :: Exp -> Exp -> Exp -> Exp
-encIfScott = app2
+encIfScott c t e = app2 c e t
 
 encList :: [Exp] -> Exp
 encList = foldr (app2 cCons) cNil
--