[GHC] #9352: Allow `State# s` argument/result types in `ccall` FFI imports

GHC ghc-devs at haskell.org
Mon Aug 4 09:58:19 UTC 2014


#9352: Allow `State# s` argument/result types in `ccall` FFI imports
-------------------------------------+-------------------------------------
              Reporter:  hvr         |            Owner:
                  Type:  feature     |           Status:  new
  request                            |        Milestone:  7.10.1
              Priority:  normal      |          Version:  7.8.2
             Component:  Compiler    |         Keywords:
  (Type checker)                     |     Architecture:  Unknown/Multiple
            Resolution:              |       Difficulty:  Unknown
      Operating System:              |       Blocked By:
  Unknown/Multiple                   |  Related Tickets:  #9281
       Type of failure:              |
  None/Unknown                       |
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------

Comment (by simonmar):

 Simon: so long as the foreign call is treated as having side effects etc.
 by the simplifier, it should be OK.  I think this code dates back to the
 original implementation of foreign calls and has only had shallow
 modifications since then (indeed if you look at `git blame` some of the
 code is very old), it's entirely possible it can be refactored to be
 simpler.

 One thing to watch out for is that `resultWrapper` is called from the
 translation for `CLabel` (i.e. `foreign import "&foo"`) wheras `boxResult`
 is called from the translation for `foreign import`.  I'm not sure whether
 that's significant or not.

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


More information about the ghc-tickets mailing list