GHCi hangs when Ctrl+Cing from infinite loop with -fbreak-on-exception set

烈酒焚心 提交于 2019-12-01 15:06:17

问题


As the title says, I create an infinite loop in GHCi:

f x = x - 2
g x = if f x < x then g (f x + 2) else x
g 2

Normally pressing Ctrl+C yields "Interrupted." and a return to the GHCi prompt. If I :set -fbreak-on-exception beforehand though, Ctrl+C does not break the loop and my only recourse is to kill the program externally.

Is there a way to break into infinite loops using GHCi? Is this a bug?

来源:https://stackoverflow.com/questions/47188857/ghci-hangs-when-ctrlcing-from-infinite-loop-with-fbreak-on-exception-set

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!