[GHC] #6074: Instance inference failure with GADTs
GHC
cvs-ghc at haskell.org
Fri May 4 15:07:36 CEST 2012
#6074: Instance inference failure with GADTs
---------------------------------+------------------------------------------
Reporter: goldfire | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.5
Keywords: GADTs | Os: Unknown/Multiple
Architecture: Unknown/Multiple | Failure: None/Unknown
Difficulty: Unknown | Testcase:
Blockedby: | Blocking:
Related: |
---------------------------------+------------------------------------------
Changes (by simonpj):
* difficulty: => Unknown
Comment:
I think this is a non-starter. Consider the translation of the orignal
code into FC:
{{{
mkString' :: GADT a -> String
mkString' g = case g of
GInt -> toString Int dStringableInt g
GBool -> toString Bool dStringableBool g
}}}
Remember that `toString :: forall a. Stringable a => a -> String`. So it
takes a value argument that is a `Stringable` dictionary. And the two
calls may LOOK the same to you, but they aren't really the same: we must
pass two different dictionaries (in this case gotten from the two instance
declarations. (And there's a different type parameter too.)
Another way to put it is: what is the FC translation of this?
{{{
mkString :: GADT a -> String
mkString g = toString g
}}}
So I don't see where to go with this one.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/6074#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list