Copyright | (c) Laurent P. René de Cotret |
---|---|
License | MIT |
Maintainer | laurent.decotret@outlook.com |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | GHC2021 |
WARNING
This module is considered internal. Using the Series
constructor
directly may result in loss or corruption of data if not handled carefully.
The Package Versioning Policy still applies.
Synopsis
Constructor
A Series v k a
is a labeled array of type v
filled with values of type a
,
indexed by keys of type k
.
Like Map
, they support efficient:
- random access by key ( \(O(\log n)\) );
- slice by key ( \(O(\log n)\) ).
Like Vector
, they support efficient:
- random access by index ( \(O(1)\) );
- slice by index ( \(O(1)\) );
- numerical operations.
Instances
Unsafe construction
fromDistinctAscList :: Vector v a => [(k, a)] -> Series v k a Source #
\(O(n)\) Build a Series
from a list of pairs, where the first elements of the pairs (the keys)
are distinct elements in ascending order. The precondition that the keys be unique and sorted is not checked.
fromDistinctAscVector :: (Vector v k, Vector v a, Vector v (k, a)) => v (k, a) -> Series v k a Source #
\(O(n)\) Build a Series
from a vector of pairs, where the first elements of the pairs (the keys)
are distinct elements in ascending order. The precondition that the keys be unique and sorted is not checked.