[GHC] #11585: Overload the static form to reduce verbosity

GHC ghc-devs at haskell.org
Tue Feb 16 12:36:38 UTC 2016


#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


More information about the ghc-tickets mailing list