[GHC] #13305: static: check for identifiers should only consider term level variables

GHC ghc-devs at haskell.org
Wed Feb 22 09:52:59 UTC 2017


#13305: static: check for identifiers should only consider term level variables
-------------------------------------+-------------------------------------
        Reporter:  edsko             |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.2
      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:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 It is entirely unclear to me whether we should allow polymorphic static
 pointers.  We certainly do not allow
 {{{
 foo1 :: forall a. Num a => StaticPtr (a->a->a)
 foo1 = static (+)
 }}}
 so why should we allow `foo` in the `Description`?

 I think of the Static Pointer Table as containing `Dynamic`s: a pair of a
 value (just a code pointer) and a `TypeRep` describing its type.  Now when
 we deserialise a static pointer we can (and jolly well should) do a
 dynamic type check.

 It might be possible to go further: see "Parametric polymorphism" in
 [wiki:StaticPointers].  But we have not even begun to implement it.

 So while the error message is not good, I'd like to rule out polymorphic
 static pointers altogether.

 I know that Facundo has use-cases where he wants polymorphism, but we
 should discuss those use-cases properly.

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


More information about the ghc-tickets mailing list