Remove MonadFail (ST s) instance
Dan Burton
danburton.email at gmail.com
Sun Nov 24 17:29:41 UTC 2019
We're talking about an instance in `base`, so if there's no other way, it
could at least be a flag akin to -Wmissing-monadfail-instances that gets
included in -Wcompat.
But relatedly: should there be a way to deprecate instances? I would say
yes.
Unfortunately, both of these options would require implementation in ghc,
which is more complex than just changing the library definitions.
-- Dan Burton
On Sun, Nov 24, 2019 at 9:20 AM David Feuer <david.feuer at gmail.com> wrote:
> How do you deprecate an instance?
>
> On Sun, Nov 24, 2019, 12:18 PM Dan Burton <danburton.email at gmail.com>
> wrote:
>
>> If someone depends on this behavior, we should give them the courtesy of
>> a proper deprecation cycle to aid them in fixing their code. That's what a
>> deprecation cycle is for. Don't skip it.
>>
>> -- Dan Burton
>>
>>
>> On Sun, Nov 24, 2019 at 7:57 AM Oleg Grenrus <oleg.grenrus at iki.fi> wrote:
>>
>>> I cannot see any justification for that instance
>>>
>>> -- | @since 4.11.0.0
>>> instance Fail.MonadFail (ST s) where
>>> fail s = errorWithoutStackTrace s
>>>
>>> If someone wants to fail pattern matches in `ST s`, please do that
>>> explicitly.
>>>
>>> I suggest and propose the removal without any deprecation period. If
>>> someone depends on this behavior, they ought to fix they code
>>> immediately: it's straight forward compiler type-error driven
>>> refactoring.
>>>
>>> Note: compatibility package
>>>
>>> https://hackage.haskell.org/package/fail-4.9.0.0/docs/Control-Monad-Fail.html
>>> doesn't have that instance, so I suspect not-that many use(d) that
>>> instance.
>>>
>>> Discussion period: 2 weeks (until Monday 2019-12-09).
>>>
>>> - Oleg
>>>
>>> P.S. you might run into problems with
>>> https://gitlab.haskell.org/ghc/ghc/issues/15681 bug/miss-feature, but
>>> there's always a workaround to write code using explicit matching
>>> combinator, so it's not a show stopper.
>>>
>>> _______________________________________________
>>> Libraries mailing list
>>> Libraries at haskell.org
>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>>>
>> _______________________________________________
>> Libraries mailing list
>> Libraries at haskell.org
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20191124/22a4d813/attachment.html>
More information about the Libraries
mailing list