[GHC] #14266: AllowAmbiguousTypes doesn't play well with default class methods

GHC ghc-devs at haskell.org
Fri Sep 22 18:44:40 UTC 2017


#14266: AllowAmbiguousTypes doesn't play well with default class methods
-------------------------------------+-------------------------------------
        Reporter:  chris-martin      |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.2
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by RyanGlScott):

 Replying to [comment:5 chris-martin]:
 > Thanks Ryan - yes that's a great description of what I was trying to do.
 One correction: I'm pretty sure `MultiMonoid` alone ''does'' require
 `AllowAmbiguousTypes` even before you get to `MultiFoldable`.

 Ah, good point. I suppose the distinction I was making in the back of my
 mind was that in `MultiMonoid`, the ambiguity comes from a type variable
 from the //class//, whereas in `MultiFoldable`, the ambiguity comes from a
 type variable from a //method// (`multi'foldMap`). I believe the former
 can coexist with `DefaultSignatures`, whereas the latter cannot (as this
 bug demonstrates).

 > It was an extended thought experiment more than anything, probably
 beyond the bounds of reasonable Haskell.

 I think you're selling your idea short! The only reason this code would
 have been considered unreasonable in the past is due to the lack of
 `TypeApplications`, but now that it's an established thing, the scope of
 what's considered "reasonable" code has increased drastically.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14266#comment:6>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list