Skip to content

Allow `State# s` argument/result types in `ccall` FFI imports

This ticket is to allowing code like

{-# 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 (closed)

Edited by Herbert Valerio Riedel
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information