[GHC] #10811: Template Haskell does associated types poorly (printing & quoting)
#10811: Template Haskell does associated types poorly (printing & quoting) -------------------------------------+------------------------------------- Reporter: goldfire | Owner: goldfire Type: bug | Status: new Priority: normal | Milestone: 7.12.1 Component: Template | Version: 7.10.2 Haskell | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Revisions: | -------------------------------------+------------------------------------- When I say {{{ {-# LANGUAGE TemplateHaskell, TypeFamilies #-} {-# OPTIONS_GHC -ddump-splices -dsuppress-uniques #-} module Bug where $([d| class C a where type F a type F a = a |]) }}} I get {{{ [d| class C a where type family F a F a = a |] ======> Bug.hs:6:7: Warning: Cannot desugar this Template Haskell declaration: class C a where type family F a F a = a }}} There are two problems here: 1. This really should work. 2. The pretty-printer here omits the `type` on the default definition for `F`. (The word `family` is optional there, but isn't actually wrong.) -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10811> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10811: Template Haskell does associated types poorly (printing & quoting) -------------------------------------+------------------------------------- Reporter: goldfire | Owner: goldfire Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Template Haskell | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by Richard Eisenberg <eir@…>): In [changeset:"1292c17e61400dfa0c27eddff4bea6a935006657/ghc" 1292c17e/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="1292c17e61400dfa0c27eddff4bea6a935006657" Allow TH quoting of assoc type defaults. This fixes #10811. }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10811#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10811: Template Haskell does associated types poorly (printing & quoting) -------------------------------------+------------------------------------- Reporter: goldfire | Owner: goldfire Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Template Haskell | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by Richard Eisenberg <eir@…>): In [changeset:"79b8e891d88bd4018e31be042364e314a25fbb41/ghc" 79b8e89/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="79b8e891d88bd4018e31be042364e314a25fbb41" Print associated types a bit better. This is part of #10811. It removes the "family" keyword from associated type family declarations, and it adds the "type" keyword to associated type family defaults. }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10811#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10811: Template Haskell does associated types poorly (printing & quoting) -------------------------------------+------------------------------------- Reporter: goldfire | Owner: goldfire Type: bug | Status: closed Priority: normal | Milestone: 8.0.1 Component: Template Haskell | Version: 7.10.2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: th/T10811 Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by goldfire): * status: new => closed * testcase: => th/T10811 * resolution: => fixed -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10811#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC