[GHC] #10522: Add UInfixT, like UInfixE or UInfixP but for types

#10522: Add UInfixT, like UInfixE or UInfixP but for types -------------------------------------+------------------------------------- Reporter: spinda | Owner: Type: feature | Status: new request | Milestone: Priority: normal | Version: 7.10.1 Component: Template | Operating System: Unknown/Multiple Haskell | Type of failure: None/Unknown Keywords: | Blocked By: Architecture: | Related Tickets: Unknown/Multiple | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- TemplateHaskell provides [https://hackage.haskell.org/package/template- haskell-2.10.0.0/docs/Language-Haskell-TH-Syntax.html#infix UInfixE and UInfixP] for punting fixity handling of infix operators in expressions and patterns. There doesn't seem to be an equivalent for type operators in TH's [https://hackage.haskell.org/package/template-haskell-2.10.0.0/docs /Language-Haskell-TH-Syntax.html#t:Type type representation], but it would be nice to have one. (In fact, it doesn't appear possible to implement this manually, either, as the TemplateHaskell doesn't expose fixity information at all for type operators, at least as far as I can tell.) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10522 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10522: Add UInfixT, like UInfixE or UInfixP but for types -------------------------------------+------------------------------------- Reporter: spinda | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Template Haskell | Version: 7.10.1 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by goldfire): * keywords: => newcomer Comment: Happy to support a newcomer in addressing this deficiency. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10522#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10522: Add UInfixT, like UInfixE or UInfixP but for types -------------------------------------+------------------------------------- Reporter: spinda | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Template Haskell | Version: 7.10.1 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by spinda): For reference: the (one-line) implementation of [https://github.com/ghc/ghc/blob/master/compiler/hsSyn/Convert.hs#L920 UInfixP] and the corresponding "[https://github.com/ghc/ghc/blob/master/compiler/hsSyn/Convert.hs#L739-L768 Converting UInfix]" note. Addressing this looks fairly straightforward. (1) Add a new {{{UInfixT Type Name Type}}} data constructor to the declaration of [https://github.com/ghc/ghc/blob/master/libraries/template- haskell/Language/Haskell/TH/Syntax.hs#L1464-L1483 Language.Haskell.TH.Syntax.Type]. (2) Add a new branch to [https://github.com/ghc/ghc/blob/058af6c90a0e8d122f2d1339b6b4fd0b5ec83d05/com... cvtTypeKind] with a one-to-one conversion to [https://downloads.haskell.org/~ghc/latest/docs/html/libraries/ghc/HsTypes.ht... HsOpTy]. Then the renamer already handles [https://github.com/ghc/ghc/blob/058af6c90a0e8d122f2d1339b6b4fd0b5ec83d05/com... restructuring the tree]. I'll try my hand at it myself when I get the time, if no one has taken it up by then. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10522#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10522: Add UInfixT, like UInfixE or UInfixP but for types -------------------------------------+------------------------------------- Reporter: spinda | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Template Haskell | Version: 7.10.1 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by goldfire): Without looking at the code myself, this sounds entirely reasonable to me. Thanks! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10522#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10522: Add UInfixT, like UInfixE or UInfixP but for types -------------------------------------+------------------------------------- Reporter: spinda | Owner: spinda Type: feature request | Status: new Priority: normal | Milestone: Component: Template Haskell | Version: 7.10.1 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D1088 -------------------------------------+------------------------------------- Changes (by spinda): * owner: => spinda * differential: => Phab:D1088 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10522#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10522: Add UInfixT, like UInfixE or UInfixP but for types
-------------------------------------+-------------------------------------
Reporter: spinda | Owner: spinda
Type: feature request | Status: new
Priority: normal | Milestone:
Component: Template Haskell | Version: 7.10.1
Resolution: | Keywords: newcomer
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Revisions: Phab:D1088
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#10522: Add UInfixT, like UInfixE or UInfixP but for types -------------------------------------+------------------------------------- Reporter: spinda | Owner: spinda Type: feature request | Status: closed Priority: normal | Milestone: Component: Template Haskell | Version: 7.10.1 Resolution: fixed | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D1088 -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10522#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC