#4530: Deriving Data for existentially quantified types
---------------------------+------------------------------------------------
Reporter: mitar | Owner:
Type: bug | Status: closed
Priority: normal | Milestone: 7.2.1
Component: Compiler | Version: 7.1
Resolution: invalid | Keywords:
Testcase: | Blockedby:
Difficulty: | Os: Unknown/Multiple
Blocking: | Architecture: Unknown/Multiple
Failure: None/Unknown |
---------------------------+------------------------------------------------
Changes (by simonpj):
* status: new => closed
* resolution: => invalid
Comment:
Do you expect to be able to? If you use a 'deriving' clause on the data
type decl you get this:
{{{
T4530.hs:8:22:
Can't make a derived instance of `Data EqBox':
Constructor `EB' does not have a Haskell-98 type
Possible fix: use a standalone deriving declaration instead
In the data type declaration for `EqBox'
}}}
With standalone deriving, GHC just generates the code and tries to
typecheck it, and indeed fails. See the manual
http://www.haskell.org/ghc/docs/7.0-latest/html/users_guide/deriving.html
#stand-alone-deriving
What do you expect to happen? Can you write a `Data` instance by hand?
I think this behaviour is just what the manual says. If you disagree, re-
open.
Simon
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4530#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs