shithub: MicroHs

Download patch

ref: 69e16fa4bab5467b9dc6e864d0e981ce0af4b4cb
parent: b4e1e10bfb77a76029982fb6806b6abe30fcfeb3
author: Lennart Augustsson <lennart.augustsson@epicgames.com>
date: Wed Sep 20 20:33:30 EDT 2023

Minor fixes.

This needs 'catch' now.

--- a/src/MicroHs/Interactive.hs
+++ b/src/MicroHs/Interactive.hs
@@ -41,7 +41,7 @@
 itName = "_it"
 
 mkIt :: String -> String
-mkIt l = itName ++ " :: Any\n" ++ itName ++ " = unsafeCoerce (" ++ l ++ ")"
+mkIt l = itName ++ " :: Any\n" ++ itName ++ " = unsafeCoerce (" ++ l ++ ")\n"
 
 oneline :: String -> I ()
 oneline line = S.do
@@ -50,7 +50,7 @@
   case exprTest of
     Right m -> evalExpr m
     Left  _ -> S.do
-      let lls = ls ++ "\n" ++ line
+      let lls = ls ++ line ++ "\n"
       defTest <- tryCompile lls
       case defTest of
         Right _ -> S.put (lls, flgs)
@@ -69,9 +69,7 @@
   S.liftIO $
     if primIsInt val then
       putStrLn $ showInt $ unsafeCoerce val
-{-
     else if primIsIO val then
       unsafeCoerce val
--}
     else
       putStrLn "Type must be Int or IO"
--