Safe Haskell | None |
---|---|
Language | Haskell2010 |
- type family DatasetConstraint (d :: * -> *) (m :: * -> *) :: Constraint
- class Dataset (d :: * -> *) where
Documentation
type family DatasetConstraint (d :: * -> *) (m :: * -> *) :: Constraint Source #
Constraints on Dataset and the monad where the operation shall be ran.
type DatasetConstraint LVec m Source # | |
class Dataset (d :: * -> *) where Source #
Abstract Dataset type class
fromListD :: [e] -> d e Source #
Create Dataset from `[]`. note that depending on the instance, it may or may not work with infinitive list.
zipD :: d e1 -> d e2 -> d (e1, e2) Source #
Zip two Datasets
sizeD :: (DatasetConstraint d m, Monad m) => d e -> m Int Source #
Get number of elements
forEachD :: (DatasetConstraint d m, Monad m) => d e -> (e -> m a) -> m [a] Source #
Apply a function on each element of Dataset
forEachD_i :: (DatasetConstraint d m, Monad m) => d e -> ((Int, e) -> m a) -> m [a] Source #
Apply a function on each element of Dataset together with the element's index. Note that the default implmentation assumes the Dataset can be created from a infinitive list.
forEachD_ni :: (DatasetConstraint d m, Monad m) => d e -> (((Int, Int), e) -> m a) -> m [a] Source #
Apply a function on each element of Dataset together with the total number of elements and the element's index.