2 ms·
> lang doesn't protect you from runtime crashes but does apparently protect you from knowing where the program crashed Can you share a sample? square x = cr
by mrkeen 6y ago
> lang doesn't protect you from runtime crashes but does apparently protect you from knowing where the program crashed
Can you share a sample?
square x = crash * x
crash = undefined
main = print (square 3)
Cause for me, this results in:
foo: Prelude.undefined
CallStack (from HasCallStack):
error, called at libraries/base/GHC/Err.hs:78:14 in base:GHC.Err
undefined, called at foo.hs:3:9 in main:Main
Maybe your mileage varied.
- marcosdumay 6y agoThis is a relatively new feature. It used to say something like 'error: undefined' and exit.