summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmily Martins <emily.flakeheart@gmail.com>2021-06-28 18:47:56 +0200
committerZubin Duggal <zubin.duggal@gmail.com>2021-09-21 22:28:29 +0530
commita5809e48358294edb07a98e8d071635be53ec195 (patch)
treeae87c22278e49f516f7c4b52b46bd3dfd3dbbeba
parent8cf2db8feb748d8847c3e9f869c7e0542296fb65 (diff)
downloadhaskell-a5809e48358294edb07a98e8d071635be53ec195.tar.gz
Unify primary and secondary GHCi prompt
Fixes #20042 Signed-off-by: Emily Martins <emily.flakeheart@gmail.com> Signed-off-by: Hécate Moonlight <hecate@glitchbra.in> (cherry picked from commit d455c39e93881dc3810ecc16a2f1bfd6c4e2fcdd) (cherry picked from commit d3fac8dd7536248cd4f14c8a55eee74bd3162e7d)
-rw-r--r--docs/users_guide/ghci.rst30
-rw-r--r--ghc/GHCi/UI.hs2
2 files changed, 16 insertions, 16 deletions
diff --git a/docs/users_guide/ghci.rst b/docs/users_guide/ghci.rst
index d5a2083eab..e533ed68a5 100644
--- a/docs/users_guide/ghci.rst
+++ b/docs/users_guide/ghci.rst
@@ -520,9 +520,9 @@ own):
.. code-block:: none
ghci> :{
- | g op n [] = n
- | g op n (h:t) = h `op` g op n t
- | :}
+ ghci| g op n [] = n
+ ghci| g op n (h:t) = h `op` g op n t
+ ghci| :}
ghci> g (*) 1 [1..3]
6
@@ -596,8 +596,8 @@ prompt. Note that layout is in effect, so to add more bindings to this
ghci> :set +m
ghci> let x = 42
- | y = 3
- |
+ ghci| y = 3
+ ghci|
ghci>
Explicit braces and semicolons can be used instead of layout:
@@ -605,9 +605,9 @@ Explicit braces and semicolons can be used instead of layout:
.. code-block:: none
ghci> do {
- | putStrLn "hello"
- | ;putStrLn "world"
- | }
+ ghci| putStrLn "hello"
+ ghci| ;putStrLn "world"
+ ghci| }
hello
world
ghci>
@@ -620,11 +620,11 @@ Multiline mode is useful when entering monadic ``do`` statements:
.. code-block:: none
ghci> flip evalStateT 0 $ do
- | i <- get
- | lift $ do
- | putStrLn "Hello World!"
- | print i
- |
+ ghci| i <- get
+ ghci| lift $ do
+ ghci| putStrLn "Hello World!"
+ ghci| print i
+ ghci|
"Hello World!"
0
ghci>
@@ -635,8 +635,8 @@ top-level prompt.
.. code-block:: none
ghci> do
- | putStrLn "Hello, World!"
- | ^C
+ ghci| putStrLn "Hello, World!"
+ ghci| ^C
ghci>
.. _ghci-decls:
diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs
index 7e1b572650..a7b532e513 100644
--- a/ghc/GHCi/UI.hs
+++ b/ghc/GHCi/UI.hs
@@ -427,7 +427,7 @@ default_stop = ""
default_prompt, default_prompt_cont :: PromptFunction
default_prompt = generatePromptFunctionFromString "ghci> "
-default_prompt_cont = generatePromptFunctionFromString "| "
+default_prompt_cont = generatePromptFunctionFromString "ghci| "
default_args :: [String]
default_args = []