
26 Feb
2017
26 Feb
'17
6:34 p.m.
Furthermore, you would not want ``` main = let 1 = 2 in print "foo" ``` to error, since the pattern match is unused, and haskell is a lazy language.
That's not at all clear. In fact, I believe this thread exists because the OP's daughter expected that it WOULD raise an error. For what it's worth, Start = let 1 = 2 in "hello" is rejected by the Clean compiler, even though Clean is much like Haskell, and 1 is otherwise allowed as a pattern. If nothing else, it would be nice to have a "dead code" warning from the compiler about code that is certain not to be evaluated. "2" counts as dead code in this example.