ocramz / sparse-linear-algebra

Numerical computation in native Haskell
GNU General Public License v3.0
88 stars 10 forks source link

`fromList` fold/overwrite behaviour toggle #53

Open ocramz opened 6 years ago

ocramz commented 6 years ago

Generalize fromListSV/fromListSM to accept a parameter to either overwrite or apply some fold over repeated elements. The current behaviour is overwriting.

Example of new behaviour:

fromListSV (FoldRepeated (+) 0) [(1, 1), (2, 3), (2, 5)] == fromListSV OverwriteRepeated [(1, 1), (2, 8)]