Allow ambiguous types (with warning) by default

David Kraeutmann kane at kane.cx
Sat Dec 5 23:54:31 UTC 2015


I don't think it'll make the language easier for beginners. It'd just be hidden type defaulting  with much more severe consequences (since it's uncontrolled). Never mind that this will cause instance selection to be nondeterministic and very weird in general (the type of an expression will depend on what instances are in scope).
On 12/6/2015 12:26 AM, Sumit Sahrawat, Maths & Computing, IIT (BHU) wrote:
> We could have a LANGUAGE pragma that makes the language easier for
> beginners.
> Provided it would not change anything major, otherwise it will be hard to
> decide how much to simplify the language.
> We can restrict it to only enabling some other extensions, one of which
> could be AllowAmbiguousTypes.
>
> On 6 December 2015 at 04:51, David Kraeutmann <kane at kane.cx> wrote:
>
> > I'm strongly against this, for a multitude of reasons. There's already a
> > mechanism for doing what you want -- type defaulting. See also
> > https://ghc.haskell.org/trac/ghc/ticket/8171 .
> >
> > On 12/5/2015 11:38 PM, David Feuer wrote:
> >> The ambiguity check produces errors that are quite surprising to the
> >> uninitiated. When the check is suppressed, the errors at use sites are
> >> typically much easier to grasp. On the other hand, there's obviously a
> > lot
> >> of value to catching mistakes as soon as possible. Would it be possible
> > to
> >> turn that into a warning by default?
> >>
> >>
> >>
> >> _______________________________________________
> >> ghc-devs mailing list
> >> ghc-devs at haskell.org
> >> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
> >>
> >
> >
> > _______________________________________________
> > ghc-devs mailing list
> > ghc-devs at haskell.org
> > http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
> >
> >
>
>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4291 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20151206/b6918f07/attachment-0001.bin>


More information about the ghc-devs mailing list