[GHC] #11585: Overload the static form to reduce verbosity
#11585: Overload the static form to reduce verbosity -------------------------------------+------------------------------------- Reporter: | Owner: facundo.dominguez | facundo.dominguez Type: feature | Status: new request | Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.3 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Static pointers are rarely used naked: most often they are defined at the base of a {{{Closure}}}, as defined in e.g. the {{{distributed-closure}}} and {{{distributed-static}}} packages. So a typical usage pattern is: {{{ distributeMap (closure (static (\x -> x * 2))) }}} which is more verbose than it needs to be. Ideally we'd just have to write {{{ distributeMap (static (\x -> x * 2)) }}} and let the static pointer be lifted to a {{{Closure}}} implicitly. i.e. what we want is to overload static literals, just like we already overload list literals and string literals. This is achieved by introducing the {{{IsStatic}}} type class and changing the typing rule for static forms slightly: {{{ static (e :: t) :: IsStatic p => p t }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11585> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11585: Overload the static form to reduce verbosity -------------------------------------+------------------------------------- Reporter: | Owner: facundo.dominguez | facundo.dominguez Type: feature request | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by facundo.dominguez: @@ -16,2 +16,2 @@ - This is achieved by introducing the {{{IsStatic}}} type class and changing - the typing rule for static forms slightly: + This could be achieved by introducing the {{{IsStatic}}} type class and + changing the typing rule for static forms slightly: New description: Static pointers are rarely used naked: most often they are defined at the base of a {{{Closure}}}, as defined in e.g. the {{{distributed-closure}}} and {{{distributed-static}}} packages. So a typical usage pattern is: {{{ distributeMap (closure (static (\x -> x * 2))) }}} which is more verbose than it needs to be. Ideally we'd just have to write {{{ distributeMap (static (\x -> x * 2)) }}} and let the static pointer be lifted to a {{{Closure}}} implicitly. i.e. what we want is to overload static literals, just like we already overload list literals and string literals. This could be achieved by introducing the {{{IsStatic}}} type class and changing the typing rule for static forms slightly: {{{ static (e :: t) :: IsStatic p => p t }}} -- -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11585#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11585: Overload the static form to reduce verbosity -------------------------------------+------------------------------------- Reporter: | Owner: facundo.dominguez | facundo.dominguez Type: feature request | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1923 Wiki Page: | -------------------------------------+------------------------------------- Changes (by facundo.dominguez): * differential: => Phab:D1923 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11585#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11585: Overload the static form to reduce verbosity -------------------------------------+------------------------------------- Reporter: | Owner: facundo.dominguez | facundo.dominguez Type: feature request | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1923 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"c1efdcc40209bc4f0ded85269eb8ba49c7d1ff09/ghc" c1efdcc4/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="c1efdcc40209bc4f0ded85269eb8ba49c7d1ff09" Overload the static form to reduce verbosity. Static pointers are rarely used naked: most often they are defined at the base of a Closure, as defined in e.g. the distributed-closure and distributed-static packages. So a typical usage pattern is: distributeMap (closure (static (\x -> x * 2))) which is more verbose than it needs to be. Ideally we'd just have to write distributeMap (static (\x -> x * 2)) and let the static pointer be lifted to a Closure implicitly. i.e. what we want is to overload static literals, just like we already overload list literals and string literals. This is achieved by introducing the IsStatic type class and changing the typing rule for static forms slightly: static (e :: t) :: IsStatic p => p t Test Plan: ./validate Reviewers: austin, hvr, bgamari Reviewed By: bgamari Subscribers: simonpj, mboes, thomie Differential Revision: https://phabricator.haskell.org/D1923 GHC Trac Issues: #11585 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11585#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11585: Overload the static form to reduce verbosity -------------------------------------+------------------------------------- Reporter: | Owner: facundo.dominguez | facundo.dominguez Type: feature request | Status: merge Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1923 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => merge -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11585#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11585: Overload the static form to reduce verbosity -------------------------------------+------------------------------------- Reporter: | Owner: facundo.dominguez | facundo.dominguez Type: feature request | Status: closed Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1923 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed Comment: Merged as 70287bceb5a339456179f08bfbe64c4fe2ff718a. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11585#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC