Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
mercurial
· 12y ago · 0 comments
Even in Haskell you can fairly easily get non-reachable code:
if a == a then ... else -- unreachable
Combine this with the unfortunate habit (which I'm also guilty of) of allowing variables to be called a' and you'll an easy-to-miss bug.
Comments
[–]
WolfeReader
12y ago
Given that types may define their own instances of Eq, the else clause might be reachable.
[–]
mercurial
OP
12y ago
And the content of the first block may be unreachable all the time, depending on the implementation of Eq. But you probably have a number of issues to worry about if your implementation of Eq doesn't work for the identity case.
[–]
loqi
12y ago
let nan = 0.0/0.0 in nan == nan