@@ -1,6 +1,7 @@
1module Control.ST
1module Control.ST
3import Language.Reflection.Utils
3import Language.Reflection.Utils
4+import Control.IOExcept
5%default total
6%default total
@@ -571,9 +572,17 @@ ConsoleIO IO where
571 putStr str = lift (Interactive.putStr str)
572 putStr str = lift (Interactive.putStr str)
572 getStr = lift Interactive.getLine
573 getStr = lift Interactive.getLine
574− putChar c = lift $ Interactive.putChar c
575+ putChar c = lift (Interactive.putChar c)
575 getChar = lift Interactive.getChar
576 getChar = lift Interactive.getChar
579+ConsoleIO (IOExcept err) where
580+ putStr str = lift (ioe_lift (Interactive.putStr str))
581+ getStr = lift (ioe_lift Interactive.getLine)
583+ putChar c = lift (ioe_lift (Interactive.putChar c))
584+ getChar = lift (ioe_lift Interactive.getChar)
578run : Applicative m => ST m a [] -> m a
587run : Applicative m => ST m a [] -> m a
579run prog = runST [] prog (\res, env' => pure res)
588run prog = runST [] prog (\res, env' => pure res)