Re:The Day Python Embarassed Imperative Programming
by _delirium on Monday February 27, 2012 @10:49AM
(#3639338)
I agree, but that particular issue can be fixed with a type system tweak instead, to treat nullability as a type modifier, vaguely like constness, which can then be statically enforced. Cyclone adds nullability annotations to C, for example, and Ada has a "null exclusion" type modifier.
[ Parent
| on HN ]
Re:The Day Python Embarassed Imperative Programming
by tmhedberg on Monday February 27, 2012 @11:06AM
(#3639409)
The advantage to Haskell's type constructor approach, though, is extensibility. Making nullability a language keyword like `const` requires a change to the fundamental grammar of the language. In Haskell, `Maybe a` is just another data type, defined entirely in Haskell itself. This opens the door to allowing users of the language to create arbitrary type system constraints without having to modify the compiler to support them.