 typedef struct iovec hs_iovec;
 #endc
 
+-- | The IOVev type is a newtype around
+-- an FFI `Ptr`, so you can pass it as is
+-- to FFI calls.
 {#pointer *hs_iovec as IOVec newtype#}
 
 withIOVec :: IOVec -> (Ptr IOVec -> IO a) -> IO a


-- | This is intented for calling into something like writev.
-- But I suppose that nothing stops you from calling into
-- readv and blowing away the passed-in ByteString.
withLazyByteString :: L.ByteString -> (IOVec -> Int -> IO b) -> IO b
withLazyByteString lbs f =
    let bs = L.toChunks lbs


{-# LANGUAGE ForeignFunctionInterface, BangPatterns #-}

{- |
 I reserve the right to make this module private at any time.
 Specifically, this module will become private once I can do
 so without breaking c2hs preprocessing.
 -}
module Foreign.IOVec
    (IOVec()
    ,withLazyByteString
    ,withByteString
    ,withIOVec
    ,writev
    )
