On Tue, 28 Sep 1999, Adrian Hey wrote:

> So (a && b) = (b && a) is invalid

&& has type
&&::Boolean->Boolean->Boolean

_|_ is not of type Boolean.  So, if you pass && a value of type _|_, 
you have violated its type requirements (precondition) and should not 
expect expect a lawful result.  

Haskell's type checker is not able to prevent you from passing _|_ to &&.
I don't think this failure makes Haskell not a functional language (all
functions have preconditions!).  
I do think it makes Haskel less than perfectly type-safe.

I believe that Charity disallows _|_.  I don't know whether the cost of
doing so is worth the gain in type safety.

-Alex-

___________________________________________________________________
S. Alexander Jacobson                   Shop.Com
1-212-697-0184 voice                    The Easiest Way To Shop








Reply via email to