当我在 ghci 中开始 session 时,我使用:
:set prompt >>
但是,某些函数调用在评估时仍会在提示符处显示模块名称。我想,除了我的自定义提示之外,我从不想要任何东西。
实际的 ghci 输出:
>>m00 <- iOIandRTfromPhrase 0.25 2 2 4 [2] 2 [2] 4.0 3
>>rs <- newMMap [("100",m00)]
>>:{
*ExperimentalConductive ExperimentalConductive Music.Theory.Bjorklund SuperDirtAction NonlinearEnsemble EnsembleNew Control.Concurrent Data.List| let lsysTest rules axiom gen phraseLength = do
*ExperimentalConductive ExperimentalConductive Music.Theory.Bjorklund SuperDirtAction NonlinearEnsemble EnsembleNew Control.Concurrent Data.List| f <- flatRandomPattern gen rules axiom [0.25,0.5..1.5] phraseLength
*ExperimentalConductive ExperimentalConductive Music.Theory.Bjorklund SuperDirtAction NonlinearEnsemble EnsembleNew Control.Concurrent Data.List| return f
*ExperimentalConductive ExperimentalConductive Music.Theory.Bjorklund SuperDirtAction NonlinearEnsemble EnsembleNew Control.Concurrent Data.List| :}
>>:{
*ExperimentalConductive ExperimentalConductive Music.Theory.Bjorklund SuperDirtAction NonlinearEnsemble EnsembleNew Control.Concurrent Data.List| let lsysTestB rules axiom gen iois phraseLength = do
*ExperimentalConductive ExperimentalConductive Music.Theory.Bjorklund SuperDirtAction NonlinearEnsemble EnsembleNew Control.Concurrent Data.List| f <- flatRandomPattern gen rules axiom iois phraseLength
*ExperimentalConductive ExperimentalConductive Music.Theory.Bjorklund SuperDirtAction NonlinearEnsemble EnsembleNew Control.Concurrent Data.List| return f
*ExperimentalConductive ExperimentalConductive Music.Theory.Bjorklund SuperDirtAction NonlinearEnsemble EnsembleNew Control.Concurrent Data.List| :}
>>
设置 prompt-cont 似乎不会改变输出。
:set prompt-cont |
Some flags have not been recognized: prompt-cont, |
:{
*ExperimentalConductive ExperimentalConductive Music.Theory.Bjorklund SuperDirtAction NonlinearEnsemble EnsembleNew Control.Concurrent Data.List| let lsys rules axiom gen phraseLength iOIs = do
回答,从下面的 leftaroundabout 开始:较旧的 ghci 需要设置 prompt2。较新的版本可能需要不同的命令,如下面的评论中所述。
最佳答案
好的,这确实是一个提示问题,但不是 prompt
问题。 :{ :}
GHCi 中的延续使用不同的提示符,即 prompt-cont
.
GHCi, version 8.2.1: http://www.haskell.org/ghc/ :? for help
Prelude> :set prompt >>
>>:set prompt-cont |
>>:{
|let foo :: [Int]
| foo = [37, 9, 18]
|:}
>>foo
[37,9,18]
在较旧的 GHCi 版本中,
prompt-cont
被称为 prompt2
:GHCi, version 7.10.2: http://www.haskell.org/ghc/ :? for help
Prelude> :set prompt >>
>>:set prompt2 |
>>:{
|let foo :: [Int]
| foo = [37, 9, 18]
|:}
>>foo
[37,9,18]
我建议您也查看
IHaskell
如果您喜欢 REPL 具有在本地代码块中定义函数的适当能力。 GHCi 对此的支持总是有点繁琐。
关于haskell - 停止 ghci 在提示符中显示模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51533529/