[GHC] #14266: AllowAmbiguousTypes doesn't play well with default class methods
GHC
ghc-devs at haskell.org
Tue Oct 3 22:34:22 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):
I like Richard's visible type pattern suggestion far more than trying to
fiddle with `InstanceSigs`. (Well, except for the fact that we don't
currently have visible type patterns. But I'll try not to be impatient.)
If we do go down this route, I suppose we'd need to eta-expand //all//
arguments of a default function when desugaring `DefaultSignatures` so
that something like this would work:
{{{#!hs
class A t where
f :: forall m. t m -> forall x. Monoid x -> m
instance A [] where
f @m tm @x = df @[] @m tm @x
}}}
Since I believe we'd need to visibly apply `@x` there in order to avoid
being ensnared in ambiguity.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14266#comment:17>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list