[GHC] #14888: The (->) type doesn't survive a TH quote-splice roundtrip

#14888: The (->) type doesn't survive a TH quote-splice roundtrip -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Template | Version: 8.2.2 Haskell | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: GHC rejects Unknown/Multiple | valid program Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- You can roundtrip function types like `Bool -> Bool` through Template Haskell splicing: {{{ $ /opt/ghc/8.2.2/bin/ghci -XTemplateHaskell GHCi, version 8.2.2: http://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /home/rgscott/.ghci λ> :m + Language.Haskell.TH λ> :k $([t| Bool -> Bool |]) $([t| Bool -> Bool |]) :: * }}} However, GHC doesn't offer the same courtesy to `(->)` applied prefix, as in the following example: {{{ λ> :k $([t| (->) Bool Bool |]) <interactive>:1:3: error: • Illegal type constructor or class name: ‘(->)’ When splicing a TH type: GHC.Prim.(->) GHC.Types.Bool GHC.Types.Bool • In the untyped splice: $([t| (->) Bool Bool |]) }}} One way to fix this would be to consistently desugar `(->)` to `ArrowT` in `DsMeta` (instead of leaving it as `GHC.Prim.(->)`). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14888 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14888: The (->) type doesn't survive a TH quote-splice roundtrip -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: Component: Template Haskell | Version: 8.2.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4466 Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => patch * differential: => Phab:D4466 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14888#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14888: The (->) type doesn't survive a TH quote-splice roundtrip
-------------------------------------+-------------------------------------
Reporter: RyanGlScott | Owner: (none)
Type: bug | Status: patch
Priority: normal | Milestone:
Component: Template Haskell | Version: 8.2.2
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: GHC rejects | Unknown/Multiple
valid program | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D4466
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ryan Scott

#14888: The (->) type doesn't survive a TH quote-splice roundtrip -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.6.1 Component: Template Haskell | Version: 8.2.2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: th/T14888 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4466 Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: patch => closed * testcase: => th/T14888 * resolution: => fixed * milestone: => 8.6.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14888#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC