{-# LANGUAGE CPP #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE FlexibleContexts #-}
#if __GLASGOW_HASKELL__ >= 702
{-# LANGUAGE Trustworthy #-}
#endif
module Foreign.Marshal.Utils.Lifted
( with
) where
import qualified Foreign as F
import System.IO ( IO )
import Prelude ( (.) )
import Control.Monad.Trans.Control ( MonadBaseControl
, liftBaseOp )
with :: (MonadBaseControl IO m, F.Storable a)
=> a
-> (F.Ptr a -> m b)
-> m b
with = liftBaseOp . F.with