Dataset
data Dataset a Source
A dataset with elements of type a
.
Constructors
Dataset | |
Fields - size :: Int
A size of the dataset.
- elemAt :: Int -> IO a
Get dataset element with a given index. The set of indices
is of a {0, 1, .., size - 1} form.
|
Reading
Construction
withVect :: [a] -> (Dataset a -> IO b) -> IO bSource
Construct dataset from a vector of elements and run the
given handler.
withDisk :: Binary a => [a] -> (Dataset a -> IO b) -> IO bSource
Construct dataset from a list of elements, store it on a disk
and run the given handler.
withData :: Binary a => Bool -> [a] -> (Dataset a -> IO b) -> IO bSource
Use disk or vector dataset representation depending on
the first argument: when True
, use withDisk
, otherwise
use withVect
.