From c6e9739b8dda909a98b4eee7f2f51d3c0e5aaf9f Mon Sep 17 00:00:00 2001 From: Brian Huffman Date: Wed, 23 Sep 2020 10:31:14 -0700 Subject: [PATCH] Remove code related to unused `LetEnabled` option. Fixes #901. --- src/Cryptol/REPL/Command.hs | 5 +---- src/Cryptol/REPL/Monad.hs | 17 ----------------- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/src/Cryptol/REPL/Command.hs b/src/Cryptol/REPL/Command.hs index 8afdb2f9d..ef9eeeaa7 100644 --- a/src/Cryptol/REPL/Command.hs +++ b/src/Cryptol/REPL/Command.hs @@ -337,10 +337,7 @@ getEvalOpts = evalCmd :: String -> REPL () evalCmd str = do - letEnabled <- getLetEnabled - ri <- if letEnabled - then replParseInput str - else P.ExprInput <$> replParseExpr str + ri <- replParseInput str case ri of P.ExprInput expr -> do (val,_ty) <- replEvalExpr expr diff --git a/src/Cryptol/REPL/Monad.hs b/src/Cryptol/REPL/Monad.hs index 03a65d31f..9608464fa 100644 --- a/src/Cryptol/REPL/Monad.hs +++ b/src/Cryptol/REPL/Monad.hs @@ -48,9 +48,6 @@ module Cryptol.REPL.Monad ( , shouldContinue , unlessBatch , asBatch - , disableLet - , enableLet - , getLetEnabled , validEvalContext , updateREPLTitle , setUpdateREPLTitle @@ -158,9 +155,6 @@ data RW = RW , eLogger :: Logger -- ^ Use this to send messages to the user - , eLetEnabled :: Bool - -- ^ Should we allow `let` on the command line - , eUpdateTitle :: REPL () -- ^ Execute this every time we load a module. -- This is used to change the title of terminal when loading a module. @@ -180,7 +174,6 @@ defaultRW isBatch l = do , eModuleEnv = env , eUserEnv = mkUserEnv userOptions , eLogger = l - , eLetEnabled = True , eUpdateTitle = return () , eProverConfig = Left SBV.defaultProver } @@ -444,16 +437,6 @@ asBatch body = do modifyRW_ $ (\ rw -> rw { eIsBatch = wasBatch }) return a -disableLet :: REPL () -disableLet = modifyRW_ (\ rw -> rw { eLetEnabled = False }) - -enableLet :: REPL () -enableLet = modifyRW_ (\ rw -> rw { eLetEnabled = True }) - --- | Are let-bindings enabled in this REPL? -getLetEnabled :: REPL Bool -getLetEnabled = fmap eLetEnabled getRW - -- | Is evaluation enabled. If the currently focused module is -- parameterized, then we cannot evalute. validEvalContext :: T.FreeVars a => a -> REPL ()