[GHC] #10891: `reify` doesn't find associated type families

GHC ghc-devs at haskell.org
Wed Sep 23 18:19:18 UTC 2015


#10891: `reify` doesn't find associated type families
-------------------------------------+-------------------------------------
        Reporter:  antalsz           |                   Owner:  osa1
            Type:  bug               |                  Status:  merge
        Priority:  normal            |               Milestone:  8.0.1
       Component:  Template Haskell  |                 Version:  7.10.2
      Resolution:                    |                Keywords:  type
                                     |  families; newcomer
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  Incorrect result  |  Unknown/Multiple
  at runtime                         |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:                    |  Differential Revisions:  Phab:D1254
-------------------------------------+-------------------------------------

Comment (by Austin Seipp <austin@…>):

 In [changeset:"5c115236fe795aa01f0c10106f1b1c959486a739/ghc"
 5c115236/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="5c115236fe795aa01f0c10106f1b1c959486a739"
 reify associated types when reifying typeclasses

 As reported in Trac #10891, Template Haskell's `reify` was not generating
 Decls
 for associated types. This patch fixes that.

 Note that even though `reifyTyCon` function used in this patch returns
 some
 type instances, I'm ignoring that.

 Here's an example of how associated types are encoded with this patch:

 (Simplified representation)

     class C a where
       type F a :: *

     -->

     OpenTypeFamilyD "F" ["a"]

 With default type instances:

     class C a where
       type F a :: *
       type F a = a

     -->

     OpenTypeFamilyD "F" ["a"]
     TySynInstD "F" (TySynEqn [VarT "a"] "a")

 Reviewed By: goldfire

 Differential Revision: https://phabricator.haskell.org/D1254

 GHC Trac Issues: #10891
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10891#comment:11>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list