Closed zilinc closed 4 years ago
But isn't that the way we've actually implemented it? Unlike other types, I always see Bool
not represented as a tagged union. I thought it was deliberate.
It doesn't matter how Bool
is implemented. An Int shouldn't be allowed to be typed Bool
. It's a bug in the typechecker.
Occasionally an integer can be typed as
Bool
.For example:
typechecks.
I think the root cause is in
==
and/=
, which are polymorphic. The constraint generated isintegral alpha
, wherealpha
is the type of the operands.