[GHC] #10267: Add support for typed holes in Template Haskell
#10267: Add support for typed holes in Template Haskell -------------------------------------+------------------------------------- Reporter: jstolarek | 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: | -------------------------------------+------------------------------------- I want to be able to work with typed holes using Template Haskell. These are currently rejected: {{{#!hs [d| i :: a -> a i x = _ |] }}} {{{ Expression form not (yet) handled by Template Haskell _ }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10267> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10267: Add support for typed holes in Template Haskell -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: jstolarek Type: feature request | Status: new Priority: normal | Milestone: Component: Template Haskell | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by jstolarek): * owner: => jstolarek -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10267#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10267: Add support for typed holes in Template Haskell -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: jstolarek Type: feature request | Status: new Priority: normal | Milestone: Component: Template Haskell | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by simonpj): By all means add typed holes. Should not be hard. Simon -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10267#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10267: Add support for typed holes in Template Haskell -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: jstolarek Type: feature request | Status: new Priority: normal | Milestone: Component: Template Haskell | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by jstolarek): Yes, the implementation is actually a matter of ~30 minutes of hacking. There is one catch though: `HsUnboundVar`, used to represent holes, always stores `RdrName`. That becomes a problem in `DsMeta`, where we expect `Name`s. My solution: parametrize `HsUnboundVar` with `id` like all the other constructors in `HsExpr`. I'm not certain if I got the details right - patch will require careful review in several place (I will mark those on Phab with inline comments). -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10267#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10267: Add support for typed holes in Template Haskell -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: jstolarek Type: feature request | Status: new Priority: normal | Milestone: Component: Template Haskell | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: Phab:D835 -------------------------------------+------------------------------------- Changes (by jstolarek): * differential: => Phab:D835 Comment: Looks like underestimated the difficulty of this - there are some issues with name handling. I will post details in a moment on Phab. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10267#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10267: Add support for typed holes in Template Haskell -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: jstolarek Type: feature request | Status: new Priority: normal | Milestone: Component: Template Haskell | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: Phab:D835 -------------------------------------+------------------------------------- Comment (by jstolarek): I'd appreciate if anyone with more knowledge of name handling inside the renamer could take a look at the Phab revision. I'm blocked with this ticket at the moment but would love to push it forward. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10267#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10267: Add support for typed holes in Template Haskell -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: jstolarek Type: feature request | Status: new Priority: normal | Milestone: Component: Template Haskell | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #10945, #10946 | Differential Rev(s): Phab:D835 Wiki Page: | -------------------------------------+------------------------------------- Changes (by jstolarek): * related: => #10945, #10946 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10267#comment:6> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10267: Add support for typed holes in Template Haskell -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: jstolarek Type: feature request | Status: new Priority: normal | Milestone: Component: Template Haskell | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #10945, #10946 | Differential Rev(s): Phab:D835 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Jan Stolarek <jan.stolarek@…>): In [changeset:"75492e7467ff962f2f2e29e5c8b2c588c94ae8a7/ghc" 75492e7/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="75492e7467ff962f2f2e29e5c8b2c588c94ae8a7" Add typed holes support in Template Haskell. Fixes #10267. Typed holes in typed Template Haskell currently don't work. See #10945 and #10946. }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10267#comment:7> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10267: Add support for typed holes in Template Haskell -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: jstolarek Type: feature request | Status: closed Priority: normal | Milestone: Component: Template Haskell | Version: 7.10.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #10945, #10946 | Differential Rev(s): Phab:D835 Wiki Page: | -------------------------------------+------------------------------------- Changes (by jstolarek): * status: new => closed * resolution: => fixed -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10267#comment:8> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10267: Add support for typed holes in Template Haskell -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: jstolarek Type: feature request | Status: closed Priority: normal | Milestone: Component: Template Haskell | Version: 7.10.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: th/T10267 Blocked By: | Blocking: Related Tickets: #10945, #10946 | Differential Rev(s): Phab:D835 Wiki Page: | -------------------------------------+------------------------------------- Changes (by jstolarek): * testcase: => th/T10267 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10267#comment:9> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10267: Add support for typed holes in Template Haskell -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: jstolarek Type: feature request | Status: closed Priority: normal | Milestone: 8.0.1 Component: Template Haskell | Version: 7.10.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: th/T10267 Blocked By: | Blocking: Related Tickets: #10945, #10946 | Differential Rev(s): Phab:D835 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"c6ac1e5f25e980c69e36581666210749811ee1c6/ghc" c6ac1e5/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="c6ac1e5f25e980c69e36581666210749811ee1c6" users_guide: TH now partially supports typed holes As requested in #10267. However we still lack support in typed splices. See #10945 and #10946. }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10267#comment:11> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10267: Add support for typed holes in Template Haskell -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: jstolarek Type: feature request | Status: closed Priority: normal | Milestone: 8.0.1 Component: Template Haskell | Version: 7.10.1 Resolution: fixed | Keywords: TypedHoles Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: th/T10267 Blocked By: | Blocking: Related Tickets: #10945, #10946 | Differential Rev(s): Phab:D835 Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonpj): * keywords: => TypedHoles -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10267#comment:12> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC