GHCi的提示可以设置如下,在我的.ghci
:
:set prompt "λ> "
但是,多行 block 中出现了不同的提示,我不知道如何更改它。如果导入的模块过多,则完全不可读:
λ> :{
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|
有没有办法设置这个辅助提示?或者,是否有其他以更友好的方式显示多行表达式的交互式运行 Haskell 的好方法?
最佳答案
您不能使用 prompt2
对于 GHC 8.2.1 及更高版本,因为接口(interface)已更改。以前是:
:set prompt <prompt> set the prompt used in GHCi
:set prompt2 <prompt> set the continuation prompt used in GHCi
现在是:
: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
这些函数的一些典型用法(只需输入您的 GHCi 或添加
~/.ghc/ghci.conf
以全局应用设置)::set prompt λ:
:set prompt-cont λ|
或者
:set prompt ghci>
:set prompt-cont ghci|
Note: space at the end of each line
关于haskell - 在多行 block 中设置 GHCi 提示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22725935/