[GHC] #7015: Add support for 'static'

GHC ghc-devs at haskell.org
Wed Aug 20 22:27:50 UTC 2014


#7015: Add support for 'static'
-------------------------------------+-------------------------------------
              Reporter:  edsko       |            Owner:
                  Type:  feature     |           Status:  patch
  request                            |        Milestone:  7.10.1
              Priority:  normal      |          Version:  7.4.2
             Component:  Compiler    |         Keywords:
            Resolution:              |     Architecture:  Unknown/Multiple
      Operating System:              |       Difficulty:  Unknown
  Unknown/Multiple                   |       Blocked By:
       Type of failure:              |  Related Tickets:
  None/Unknown                       |
             Test Case:              |
              Blocking:              |
Differential Revisions:  Phab:D119   |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 OK so it sounds as if `Static` is 100% part of the library layer, and GHC
 knows nothing about it.  That's fine; and will become clear when you re-
 structure.

 Concerning upheaving, my main goal is to have clean, well-designed
 primitives in GHC.  I don't fully understand the `Any`  business (e.g. how
 can it possible deal with polymorphic functions with more than one type
 parameter `forall a b. a -> b -> b`?), but it smells like a hack.  And I
 don't want to enshrine a hack in GHC.

 Perhaps we could say, for now, that the argument of `static` must have no
 free type variables, just as it has no free term variables (other than top
 level constants).  So,
 {{{
 y1 :: forall a. Static ([a] -> [a])
 y1 = static reverse
 }}}
 would be rejected, but
 {{{
 y3 :: Static ([Any] -> [Any])
 y3 = static reverse
 }}}
 would be accepted.  Now you can continue to do your current hack in the
 library (pending a better solution for polymorphism), but the GHC part
 remains simple and clean.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/7015#comment:22>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list