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

GHC ghc-devs at haskell.org
Sat Jun 20 09:12:59 UTC 2015


#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/compiler/hsSyn/Convert.hs#L989
 cvtTypeKind] with a one-to-one conversion to
 [https://downloads.haskell.org/~ghc/latest/docs/html/libraries/ghc/HsTypes.html#v:HsOpTy
 HsOpTy]. Then the renamer already handles
 [https://github.com/ghc/ghc/blob/058af6c90a0e8d122f2d1339b6b4fd0b5ec83d05/compiler/rename/RnTypes.hs#L153-L166
 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


More information about the ghc-tickets mailing list