ZipArray
Provides an alternative Apply
implementation for arrays.
Installation
npm install ziparray
Motivation
The common implementation of Apply
for arrays works with all combinations. However, there is another implementation of Apply
for arrays that works in "pairwise" fashion. You can think of this as a data type level encoding of the zip
family of functions. Encoding the effect ("pairwise" application) in the data type allows us to write code that expresses our intentions better.
Usage
Fantasy Land
> const ZipArray = ;undefined> > > > >
Static Land
> const ZipArray = ;undefined> const map ap = ZipArray;undefined> 11 12 13 > 2 6 > 2 6 > 4 800