Instance warnings [Re: Remove MonadFail (ST s) instance]

George Wilson george at wils.online
Tue Nov 26 01:11:02 UTC 2019


Some kind of instance warning like this would enable library authors
to migrate type class instances. The Core Libraries Committee would
likely be able to use this for good. I would definitely like to see
that happen.
Type class instances are "stuck" in Haskell today.

On Tue, 26 Nov 2019 at 08:10, Oliver Charles <ollie at ocharles.org.uk> wrote:
>
> Perhaps I have found motivation for my first proposal!
>
> On Mon, Nov 25, 2019 at 10:06 PM David Feuer <david.feuer at gmail.com> wrote:
> >
> > That definitely sounds like a good approach to me!
> >
> > On Mon, Nov 25, 2019, 5:04 PM Oliver Charles <ollie at ocharles.org.uk> wrote:
> >>
> >> I wonder if like TypeError we could have TypeWarning? Then you could
> >> have something like
> >>
> >> instance TypeWarning "Please use Fooble instead" => Show Foo where
> >>
> >> which would compile, but produce a warning whenever the `Show Foo`
> >> constraint was solved?
> >>
> >> On Mon, Nov 25, 2019 at 4:28 PM Andreas Abel <andreas.abel at ifi.lmu.de> wrote:
> >> >
> >> > Derailing...
> >> > Incidently, I recently asked for a "instance warning" feature in GHC:
> >> >
> >> >    https://gitlab.haskell.org/ghc/ghc/issues/17485
> >> >
> >> > (In my case I could go with a TypeError constraint instead.)
> >> >
> >> > Maybe instance warnings could be a useful feature.  It could be
> >> > implemented along the TypeError mechanism.
> >> >
> >> > On 2019-11-24 18:35, Henning Thielemann wrote:
> >> > >
> >> > > On Sun, 24 Nov 2019, Dan Burton wrote:
> >> > >
> >> > >> 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.
> >> > >
> >> > > Sounds like another application of instance warnings that we already
> >> > > talked about:
> >> > >     https://gitlab.haskell.org/ghc/ghc/issues/11796
> >> > > _______________________________________________
> >> > > 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
> >> _______________________________________________
> >> 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


More information about the Libraries mailing list