Closed csternagel closed 6 years ago
Just a further remark: For me stack ghc
doesn't check assertions (that's why I didn't notice the above issue at first), but for some of my students (in one case I have seen this with my own eyes) stack ghc
still checks assertions. I have no clue why ghc
behaves different on our machines (I thought the purpose of stack
was that this does not happen) ;)
another wrong assertion
Thanks, I fixed that.
I have no clue why ghc behaves different on our machines
Strange. For me, stack ghc
doesn't check assertions neither, but according to ghc's manual
GHC ignores assertions when optimisation is turned on with the -O flag. [..] You can also disable assertions using the -fignore-asserts option.
Thus, when just running stack ghc Bug.hs
, I'd expect assertions being checked since I neither used -O
nor -fignore-asserts
.
Anyway, the present issue should be fixed. Thanks again!
I think I stumbled over another wrong assertion (in line 231 of
EncodedAdt.hs
).Its strange effect for students in my class was that for those students who (accidentally) had 2^n constructors, decoding succeeded but for others (where the number of constructors was not a power of 2) it failed.