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