@@ -1,6 +1,7 @@
11module Control.ST
22
33import Language.Reflection.Utils
4+import Control.IOExcept
45
56%default total
67
@@ -571,9 +572,17 @@ ConsoleIO IO where
571572 putStr str = lift (Interactive.putStr str)
572573 getStr = lift Interactive.getLine
573574
574− putChar c = lift $ Interactive.putChar c
575+ putChar c = lift (Interactive.putChar c)
575576 getChar = lift Interactive.getChar
576577
578+export
579+ConsoleIO (IOExcept err) where
580+ putStr str = lift (ioe_lift (Interactive.putStr str))
581+ getStr = lift (ioe_lift Interactive.getLine)
582+
583+ putChar c = lift (ioe_lift (Interactive.putChar c))
584+ getChar = lift (ioe_lift Interactive.getChar)
585+
577586export
578587run : Applicative m => ST m a [] -> m a
579588run prog = runST [] prog (\res, env' => pure res)