Module
Data.Slice
- Package
- purescript-slice
- Repository
- jacereda/purescript-slices
A data type with O(1) take/drop using an array as the underlying storage.
#sconcatMap Source
sconcatMap :: forall b a. (a -> Slice b) -> Slice a -> Slice b
Apply a function to each element in an array, and flatten the results into a single, new array.
#szipWith Source
szipWith :: forall c b a. (a -> b -> c) -> Slice a -> Slice b -> Slice c
Apply a function to pairs of elements at the same index in two slices, collecting the results in a new slice.
If one slice is longer, elements will be discarded from the longer slice.
For example
szipWith (*) (slice [1, 2, 3]) (slice [4, 5, 6, 7]) == slice [4, 10, 18]
- Modules
- Data.
Slice