[GHC] #12473: Ambiguous type var with DefaultSignatures and FunctionalDependencies
GHC
ghc-devs at haskell.org
Wed Aug 24 08:59:17 UTC 2016
#12473: Ambiguous type var with DefaultSignatures and FunctionalDependencies
-------------------------------------+-------------------------------------
Reporter: dylex | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler (Type | Version: 8.0.1
checker) |
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: GHC rejects | Unknown/Multiple
valid program | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by simonpj):
But we ''do'' call a function with the type given by the generic default
signature! In effect the generic-default declaration gives rise to a
definition
{{{
$gdm_bar :: forall a b. (Bar a b, Foo a b) => b -> Int
$gdm_bar b = foo (get b :: a) b
}}}
In an instance declaration where you do not give a declaration for `bar`,
we fill in with this generic default method. That is
{{{
instance blah => Bar t1 t2 where {}
}}}
becomes
{{{
instance blah => Bar t1 t2 where
bar = $gdm_bar
}}}
If the type of `$gdm_bar` was ambiguous, this really would be a problem.
But in this case it isn't! I'll investigate
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12473#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list