What exactly happens in GHCi when I load a file with a line that says: 0=1 ?
I was expecting that this would give an error but it doesn't seem to do anything at all. Does it do anything?
I assume it's equivalent in GHCi to just saying "let 0=1". What does that do?
The 0
in your let
binding is actually a pattern match on the literal 0
. I wasn't sure what was going on at first too, but you can confirm this by using strict pattern matching like so:
Prelude> :set -XBangPatterns
Prelude> let !0 = 1 in 0
*** Exception: <interactive>:13:5-10: Non-exhaustive patterns in pattern binding
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With