on master help sign in
Fix File effect
ff1dc88Edwin Brady
libs/effects/Effect/File.idr+2−2
@@ -79,7 +79,7 @@ instance Handler FileIO IO where
79 k True (FH h)
79 k True (FH h)
80 handle (FH h) Close k = do closeFile h
80 handle (FH h) Close k = do closeFile h
81 k () ()
81 k () ()
82− handle (FH h) ReadLine k = do Right str <- fGetStr h
82+ handle (FH h) ReadLine k = do Right str <- fGetLine h
83 -- Need proper error handling!
83 -- Need proper error handling!
84 | Left err => k "" (FH h)
84 | Left err => k "" (FH h)
85 k str (FH h)
85 k str (FH h)
@@ -95,7 +95,7 @@ instance Handler FileIO (IOExcept a) where
95 k True (FH h)
95 k True (FH h)
96 handle (FH h) Close k = do ioe_lift $ closeFile h
96 handle (FH h) Close k = do ioe_lift $ closeFile h
97 k () ()
97 k () ()
98− handle (FH h) ReadLine k = do Right str <- ioe_lift $ fGetStr h
98+ handle (FH h) ReadLine k = do Right str <- ioe_lift $ fGetLine h
99 -- Need proper error handling!
99 -- Need proper error handling!
100 | Left err => k "" (FH h)
100 | Left err => k "" (FH h)
101 k str (FH h)
101 k str (FH h)