在多行块中设置GHCi提示

bet*_*ros 13 haskell ghci

GHCi的提示可以设置如下,在我的.ghci:

:set prompt "?> "
Run Code Online (Sandbox Code Playgroud)

但是,多行块中会出现不同的提示,我无法弄清楚如何更改它.如果导入的模块太多,则完全无法读取:

?> :{
Prelude Control.Arrow Control.Applicative Control.Monad Control.Concurrent Control.Concurrent.Async Control.Parallel Data.String Data.Char Data.List Data.Maybe Data.Monoid Control.Monad.IO.Class|
Run Code Online (Sandbox Code Playgroud)

有没有办法设置这个辅助提示?或者,还有其他好方法以交互方式运行Haskell,其中多线表达式以更友好的方式显示吗?

ham*_*mar 9

在GHC 7.8.1及更高版本中,您可以使用更改连续提示:set prompt2.

GHC#7509.


She*_*rsh 8

prompt2由于接口已更改,因此不能再使用GHC 8.2.1及更新版本.以前是:

   :set prompt <prompt>        set the prompt used in GHCi
   :set prompt2 <prompt>       set the continuation prompt used in GHCi
Run Code Online (Sandbox Code Playgroud)

现在是:

   :set prompt <prompt>        set the prompt used in GHCi
   :set prompt-cont <prompt>   set the continuation prompt used in GHCi
   :set prompt-function <expr> set the function to handle the prompt
   :set prompt-cont-function <expr> set the function to handle the continuation prompt
Run Code Online (Sandbox Code Playgroud)