-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Memory map immutable and mutable vectors
--   
--   Memory map immutable and mutable vectors.
@package vector-mmap
@version 0.0.3

module Data.Vector.Storable.MMap

-- | Mode of mapping. Four cases are supported.
data Mode :: *

-- | file is mapped read-only, file must exist
ReadOnly :: Mode

-- | file is mapped read-write, file must exist
ReadWrite :: Mode

-- | file is mapped read-write, but changes aren't propagated to disk, file
--   must exist
WriteCopy :: Mode

-- | file is mapped read-write, if file does not exist it will be created
--   with default permissions, region parameter specifies size, if file
--   size is lower it will be extended with zeros
ReadWriteEx :: Mode

-- | Map a file into memory as a mutable vector.
unsafeMMapMVector :: forall a. Storable a => FilePath -> Mode -> Maybe (Int64, Int) -> IO (MVector (PrimState IO) a)

-- | Map a file into memory (<a>ReadOnly</a> mode) as an immutable vector.
unsafeMMapVector :: forall a. Storable a => FilePath -> Maybe (Int64, Int) -> IO (Vector a)

-- | Write a file from a vector Be careful with existing files, parts
--   behind the mapped range will stay as they are before the write
--   operation.
writeMMapVector :: forall v a. (Storable a, Vector v a) => FilePath -> v a -> IO ()
