Thank you for your reply.

It was designed that way.   This also goes for Failure objects, which are a 
subclass of Nil.

Nil (and its subclass Failure) are exempt from type checking.

The case of Failure should be clear: if you want to return a Failure because 
something went wrong, you don't want it to trip off the type checking.

Yes, it does make sense when thinking of Failure objects as a kind of exception.

You should think of Nil as a type of benevolent Failure: nothing really wrong, 
but it could not produce an actual value.

It's clear to me this way.

My only remaining doubt is, why allow the `:D` smiley at all for return types if it has no effect? Is it used as some kind of statement of intent? That's how I'm using it right now in my own code, to know I don't need to check for Nil when getting a value from that function. But it would be nice to have the compiler help in fulfilling that.

Reply via email to