Proposal to deprecate and then drop fromJust

Bardur Arantsson spam at scientician.net
Tue Feb 24 16:24:39 UTC 2015


On 24-02-2015 11:15, Joachim Breitner wrote:
> Hi,
> 
> Am Dienstag, den 24.02.2015, 11:11 +0100 schrieb Henning Thielemann:
>> On Mon, 23 Feb 2015, Erik de Castro Lopo wrote:
>>> The idea would be to deprecate fromMaybe for 7.12 and remove it
>>> completely later.
>>
>> I would deprecate it, but not remove it. Otherwise people will think that 
>> this obvious function is missing by accident. We would then encounter 
>> various discussions about adding it in the close future.
> 

-1 to the original proposal. Obviously -- it would cause far too much
breakage for very little upside.

> that’s a more useful idea, but again: Why fromJust and not head etc..?
> 
> 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.

Yes, this would definitely be useful. (Should perhaps be turned on by
default for non-ghci? That might usefull help prod unaware people in the
direction of total functions.)

Then in 2020 or 2025 or so someone could do a survey of github/hackage
to see what the breakage would be from actually froming fromJust, &c.

Regards,




More information about the Libraries mailing list