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

GHC ghc-devs at haskell.org
Wed Jul 23 19:15:57 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:              |
-------------------------------------+-------------------------------------
Changes (by hvr):

 * related:  #9218 => #9281


Old description:

> This ticket is to allowing code like
>
> {{{#!hs
> {-# LANGUAGE UnliftedFFITypes #-}
> {-# LANGUAGE MagicHash #-}
>
> module M where
>
> import GHC.Exts
>
> foreign import ccall unsafe "foo" c_foo :: Int# -> State# s -> State# s
>
> foreign import ccall unsafe "bar" c_foo :: Int# -> State# s -> (# State#
> s, Int# #)
> }}}
>
> See also discussion in #9218

New description:

 This ticket is to allowing code like

 {{{#!hs
 {-# LANGUAGE UnliftedFFITypes #-}
 {-# LANGUAGE MagicHash #-}
 {-# LANGUAGE UnboxedTuples #-}

 module M where

 import GHC.Exts

 foreign import ccall unsafe "foo" c_foo :: Int# -> State# s -> State# s

 foreign import ccall unsafe "bar" c_foo :: Int# -> State# s -> (# State#
 s, Int# #)
 }}}

 See also discussion in #9281

--

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


More information about the ghc-tickets mailing list