4 ms·
The OP addresses your question, saying he is not advocating for removing laziness, but does have some specific suggestions. > I'm not advocating for removing l
by jrochkind1 6y ago
The OP addresses your question, saying he is not advocating for removing laziness, but does have some specific suggestions.
> I'm not advocating for removing laziness in Haskell. In fact I'm not really advocating for much of anything in this series. I'm just complaining, because I like complaining.
> But if I was to advocate some changes:
* Deprecate partial functions
* Introduce a naming scheme for partial functions to be more obvious
* Introduce a compiler warning to note partial function use (with a pragma to turn off specific usages)
* Warn by default on partial pattern matches
* Advocate strict data fields by default
- colonwqbang 6y agoChange all partial functions from returning a to returning Maybe a. Then we rename the fromJust function into the $%&!# operator (name intended to suggest the exclamation made by the programmer when function fails).
- _ezkx 6y agoIf StrictData were simply made the new default (with exceptions for lists and some other things in the standard lib), I bet very little code would break. It certainly wouldn't change the flavor of the language. I think it's a good idea.