File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,8 +12,8 @@ instance teletypeFFunctor :: Functor TeletypeF where
1212
1313type Teletype = Free TeletypeF
1414
15- putStrLn :: String -> Teletype { }
16- putStrLn s = liftF $ PutStrLn s {}
15+ putStrLn :: String -> Teletype Unit
16+ putStrLn s = liftF $ PutStrLn s unit
1717
1818getLine :: Teletype String
1919getLine = liftF $ GetLine (\a -> a)
@@ -29,5 +29,8 @@ echo = do
2929 a <- getLine
3030 putStrLn a
3131 putStrLn " Finished"
32+ return $ a ++ a
3233
33- main = run $ echo
34+ main = do
35+ a <- run $ echo
36+ trace a
Original file line number Diff line number Diff line change @@ -129,10 +129,7 @@ foreign import goEffImpl
129129 \ return function(){\
130130 \ while (true) {\
131131 \ var r = resume(value);\
132- \ if (isRight(r)) {\
133- \ var x = fromRight(r);\
134- \ return function() { return x; };\
135- \ }\
132+ \ if (isRight(r)) return fromRight(r);\
136133 \ value = fn(fromLeft(r))();\
137134 \ }\
138135 \ };\
You can’t perform that action at this time.
0 commit comments