[commit: ghc] master: Fix #14973 (e408d03)

git at git.haskell.org git at git.haskell.org
Mon May 14 12:50:15 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/e408d03b512f353067879ecdb5be4b6e48cf0431/ghc

>---------------------------------------------------------------

commit e408d03b512f353067879ecdb5be4b6e48cf0431
Author: Denis M <Nolane16 at gmail.com>
Date:   Mon May 14 00:08:36 2018 -0400

    Fix #14973
    
    Reviewers: bgamari
    
    Reviewed By: bgamari
    
    Subscribers: thomie, carter
    
    Differential Revision: https://phabricator.haskell.org/D4661


>---------------------------------------------------------------

e408d03b512f353067879ecdb5be4b6e48cf0431
 ghc/GHCi/UI.hs | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs
index 349368b..3ed1c7f 100644
--- a/ghc/GHCi/UI.hs
+++ b/ghc/GHCi/UI.hs
@@ -791,16 +791,14 @@ checkPromptStringForErrors (_:xs) = checkPromptStringForErrors xs
 checkPromptStringForErrors "" = Nothing
 
 generatePromptFunctionFromString :: String -> PromptFunction
-generatePromptFunctionFromString promptS = \_ _ -> do
-    (context, modules_names, line) <- getInfoForPrompt
-
-    let
+generatePromptFunctionFromString promptS modules_names line =
+        processString promptS
+  where
         processString :: String -> GHCi SDoc
         processString ('%':'s':xs) =
             liftM2 (<>) (return modules_list) (processString xs)
             where
-              modules_list = context <> modules_bit
-              modules_bit = hsep $ map text modules_names
+              modules_list = hsep $ map text modules_names
         processString ('%':'l':xs) =
             liftM2 (<>) (return $ ppr line) (processString xs)
         processString ('%':'d':xs) =
@@ -861,8 +859,6 @@ generatePromptFunctionFromString promptS = \_ _ -> do
         processString "" =
             return empty
 
-    processString promptS
-
 mkPrompt :: GHCi String
 mkPrompt = do
   st <- getGHCiState



More information about the ghc-commits mailing list