[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 <ryan.gl.scott@…>): In [changeset:"6ee831f279c91888ee5815f8eee473bcd6fd25c6/ghc" 6ee831f/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="6ee831f279c91888ee5815f8eee473bcd6fd25c6" Fix #14888 by adding more special cases for ArrowT Summary: There were previously some situations where `(->)` would not be desugared or reified as `ArrowT`, leading to various oddities such as those observed in #14888. We now uniformly treat `(->)` as `ArrowT` in Template Haskell–world by checking for any tycon that has the same name as `(->)`, and converting that to `ArrowT`. Test Plan: make test TEST=T14888 Reviewers: goldfire, bgamari, simonpj Reviewed By: goldfire, simonpj Subscribers: simonpj, rwbarton, thomie, carter GHC Trac Issues: #14888 Differential Revision: https://phabricator.haskell.org/D4466 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14888#comment:2> 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: 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