repa-io-3.4.1.1: Read and write Repa arrays in various formats.

Data.Array.Repa.IO.Vector

Description

Read and write vectors as ASCII text files.

The file format is like:

     VECTOR                  -- header
100                     -- length of vector
1.23 1.56 1.23 ...      -- data, separated by whitespace
....


Synopsis

# Documentation

readVectorFromTextFile :: (Num e, Read e, Unbox e) => FilePath -> IO (Array U DIM1 e) Source #

Read a vector from a text file.

• WARNING: This is implemented fairly naively, just using Strings under the covers. It will be slow for large data files.
• It also doesn't do graceful error handling. If the file has the wrong format you'll get a confusing error.

writeVectorToTextFile :: (Show e, Source r e) => Array r DIM1 e -> FilePath -> IO () Source #

Write a vector as a text file.