[Haskell-cafe] If you'd design a Haskell-like language, what would you do different?

Ben Lippmeier benl at ouroborus.net
Tue Dec 20 11:24:43 CET 2011


On 20/12/2011, at 9:06 PM, Thiago Negri wrote:
>> There isn't one!
>> 
>> Bottoms will be the null pointers of the 2010's, you watch.


> How would you represent it then?

Types probably. In C, the badness of null pointers is that when you inspect an  int*  you don't always find an int. Of course the superior Haskell solution is to use algebraic data types, and represent a possibly exceptional integer by "Maybe Int". But then when you inspect a "Maybe Int" you don't always get an .. ah.


> Would it cause a compiler error?


Depends whether you really wanted an Int or not.

Ben.




More information about the Haskell-Cafe mailing list