[GHC] #10460: Allow foreign prim to return Any

GHC ghc-devs at haskell.org
Mon Jun 1 17:06:16 UTC 2015


#10460: Allow foreign prim to return Any
-------------------------------------+-------------------------------------
        Reporter:  ezyang            |                   Owner:  ezyang
            Type:  feature request   |                  Status:  new
        Priority:  normal            |               Milestone:  7.12.1
       Component:  Compiler (Type    |                 Version:  7.11
  checker)                           |                Keywords:
      Resolution:                    |            Architecture:
Operating System:  Unknown/Multiple  |  Unknown/Multiple
 Type of failure:  GHC rejects       |               Test Case:
  valid program                      |                Blocking:
      Blocked By:                    |  Differential Revisions:
 Related Tickets:                    |
-------------------------------------+-------------------------------------

Comment (by ezyang):

 > And you are only proposing to add Any as a possible result for foreign
 prim not for other foreign declarations, correct?

 Yep.

 > Who converts the argument to Any? The caller? With unsafeCoerce?

 Yes and yes. Another possibility is to accept arbitrary types for foreign
 prim ops (in the same way that GHC's primop mechanism works), but that's
 more work.

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


More information about the ghc-tickets mailing list