
#11341: Reifying a GADT doesn't tell you the correct return type -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Template Haskell | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by jstolarek): Replying to [comment:3 RyanGlScott]:
That's a good point I hadn't thought of. We definitely don't want users to be able to splice in type indices that don't match up with the actual return type. Just to be clear: TH syntax tree already allows to write all sorts of silliness that we have to catch later on in the pipeline. This would be another such thing. I just fear that the check would not be trivial. I also think that in most cases GADT result type simply includes indexed type constructor and having to duplicate the indices will be painful.
I suppose the real type indices can always be found out through something like `expand` in `th-desugar`. In such corner cases that you've demonstrated indices might be very hard (impossible?) to recover. But I think that's acceptable.
-- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11341#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler