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


-- | Read and write Repa arrays in various formats.
--   
--   Read and write Repa arrays in various formats.
@package repa-io
@version 3.4.1.1


-- | Reading and writing arrays as uncompressed 24 or 32 bit Windows BMP
--   files.
module Data.Array.Repa.IO.BMP

-- | Read RGB components from a BMP file.
readImageFromBMP :: FilePath -> IO (Either Error (Array U DIM2 (Word8, Word8, Word8)))

-- | Write RGB components to a BMP file.
writeImageToBMP :: FilePath -> Array U DIM2 (Word8, Word8, Word8) -> IO ()


-- | Reading and writing Repa arrays as binary files.
module Data.Array.Repa.IO.Binary

-- | Read an array from a file. Data appears in host byte order. If the
--   file size does match the provided shape then <a>error</a>.
readArrayFromStorableFile :: forall a sh. (Shape sh, Storable a) => FilePath -> sh -> IO (Array F sh a)

-- | Write an array to a file. Data appears in host byte order.
writeArrayToStorableFile :: forall sh a r. (Shape sh, Source r a, Storable a) => FilePath -> Array r sh a -> IO ()


-- | Read and write matrices as ASCII text files.
--   
--   The file format is like:
--   
--   <pre>
--   MATRIX                  -- header
--   100 100                 -- width and height
--   1.23 1.56 1.23 ...      -- data, separated by whitespace
--   ....
--   
--   </pre>
module Data.Array.Repa.IO.Matrix

-- | Read a matrix from a text file.
--   
--   <ul>
--   <li>WARNING: This is implemented fairly naively, just using
--   <tt>Strings</tt> under the covers. It will be slow for large data
--   files.</li>
--   <li>It also doesn't do graceful error handling. If the file has the
--   wrong format you'll get a confusing <a>error</a>.</li>
--   </ul>
readMatrixFromTextFile :: (Num e, Read e, Unbox e) => FilePath -> IO (Array U DIM2 e)

-- | Write a matrix as a text file.
writeMatrixToTextFile :: (Show e, Source r e) => FilePath -> Array r DIM2 e -> IO ()


-- | Timing utilities used for benchmarks in the <tt>repa-examples</tt>
--   package.
module Data.Array.Repa.IO.Timing

-- | Abstract representation of process time.
data Time
milliseconds :: TimeUnit
microseconds :: TimeUnit
cpuTime :: TimeUnit -> Time -> Integer
wallTime :: TimeUnit -> Time -> Integer

-- | Time some IO action. Make sure to deepseq the result before returning
--   it from the action. If you don't do this then there's a good chance
--   that you'll just pass a suspension out of the action, and the
--   computation time will be zero.
time :: IO a -> IO (a, Time)

-- | Subtract second time from the first.
minus :: Time -> Time -> Time

-- | Add two times.
plus :: Time -> Time -> Time

-- | Show a time as a string, in milliseconds.
showTime :: Time -> String

-- | Pretty print the times, in milliseconds.
prettyTime :: Time -> String


-- | Read and write vectors as ASCII text files.
--   
--   The file format is like:
--   
--   <pre>
--   VECTOR                  -- header
--   100                     -- length of vector
--   1.23 1.56 1.23 ...      -- data, separated by whitespace
--   ....
--   
--   </pre>
module Data.Array.Repa.IO.Vector

-- | Read a vector from a text file.
--   
--   <ul>
--   <li>WARNING: This is implemented fairly naively, just using
--   <tt>Strings</tt> under the covers. It will be slow for large data
--   files.</li>
--   <li>It also doesn't do graceful error handling. If the file has the
--   wrong format you'll get a confusing <a>error</a>.</li>
--   </ul>
readVectorFromTextFile :: (Num e, Read e, Unbox e) => FilePath -> IO (Array U DIM1 e)

-- | Write a vector as a text file.
writeVectorToTextFile :: (Show e, Source r e) => Array r DIM1 e -> FilePath -> IO ()
