mirror of
https://github.com/GaloisInc/cryptol.git
synced 2024-12-01 08:32:23 +03:00
add proper MonadIO instance for REPL
This commit is contained in:
parent
f22cbdc4eb
commit
2bb86303bb
@ -133,9 +133,6 @@ data Cryptolrc =
|
||||
|
||||
-- Utilities -------------------------------------------------------------------
|
||||
|
||||
instance MTL.MonadIO REPL where
|
||||
liftIO = io
|
||||
|
||||
instance MonadException REPL where
|
||||
controlIO branchIO = REPL $ \ ref -> do
|
||||
runBody <- branchIO $ RunIO $ \ m -> do
|
||||
|
@ -82,6 +82,7 @@ import qualified Cryptol.Parser.AST as P
|
||||
import Cryptol.Symbolic (proverNames, lookupProver)
|
||||
|
||||
import Control.Monad (ap,unless,when)
|
||||
import Control.Monad.IO.Class
|
||||
import Data.Char (isSpace)
|
||||
import Data.IORef
|
||||
(IORef,newIORef,readIORef,modifyIORef)
|
||||
@ -172,6 +173,8 @@ instance Monad REPL where
|
||||
x <- unREPL m ref
|
||||
unREPL (f x) ref
|
||||
|
||||
instance MonadIO REPL where
|
||||
liftIO = io
|
||||
|
||||
-- Exceptions ------------------------------------------------------------------
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user