Proposal to deprecate and then drop fromJust

Henning Thielemann lemming at henning-thielemann.de
Tue Feb 24 10:33:56 UTC 2015


On Tue, 24 Feb 2015, Joachim Breitner wrote:

> If you would continue this thought of line towards some consistency, 
> then we’d need a way to annotate partial functions in general, and have 
> a dedicated flag -fwarn-partial-functions. (It would behave just like 
> deprecations – but reported separately.).  This would go well with 
> -fwarn-incomplete-patterns. Such a thing might be useful.

I have thought about it in the past and it is certainly better than no 
such warning. On the other hand partiality can be caused by infinite loops 
and is then hard to detect. To be completely sure you would have to 
implement a termination checker as in liquid-haskell. Nonetheless, a 
partiality marker for every function that might call 'error' or 
'undefined' would be useful.


More information about the Libraries mailing list