gpt4 book ai didi

haskell - GHCI 断点问题

转载 作者:行者123 更新时间:2023-12-02 12:42:26 26 4
gpt4 key购买 nike

这是一个玩具函数,在文件中定义,将其命名为 test.hs:

x a b c = do
putStrLn $ show a
return a

当然可以将其导入 GHCI 并设置断点:

λ :load test.hs 
[1 of 1] Compiling Main ( test.hs, interpreted )
Ok, modules loaded: Main.
λ :break x
Breakpoint 3 activated at test2.hs:(1,1)-(3,12)
λ x 1 2 3
Stopped at test2.hs:(1,1)-(3,12)
_result :: IO b = _

然而似乎没有办法检查参数 b 和 c。

有什么办法可以解决这个问题吗?我正在运行 GHCi 7.8.4。

最佳答案

来自GHC user's guide :

GHCi has provided bindings for the free variables[6] of the expression on which the breakpoint was placed ...

[6] We originally provided bindings for all variables in scope, rather than just the free variables of the expression, but found that this affected performance considerably, hence the current restriction to just the free variables.

关于haskell - GHCI 断点问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29999476/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com