You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think massiv is a great library and delivers great performance. However, I believe it is also very hard to use due to the complicated types. Here are some rather radical ideas which might improve the situation.
Assume Seq everywhere which is usually the right choice. If parallel computation is desired, Par should be specified when computing.
Remove function names with ' at the end. I think the partial functions should be the default ones; indexing/dimension errors are usually programming errors.
Be less polymorphic. Make makeArray and other generation functions return delayed arrays to aid type inference and make it less confusing.
Support OverloadedRecordDot for IxN and SzN to get the individual coordinates
The doc page for Data.Massiv.Array is very long and it is often hard to find the right functions. Maybe put the M variants in a different place and have a separate docs for them (e.g. Data.Massiv.Array.Safe).
Combine the safe and partial functions into one by combining Dimension n and Dim, i.e. provide a constructor for Dimension that is not checked.
Replace index, read with a partial function. I would imagine that many people use them in combination with fromJust.
There are potentially too many different representations. However, I am not too sure what to do here.
Please feel free to tell me what you think about these changes. Not all of them might be good but I included them to be thought-provoking.
These changes are obviously breaking changes and would need a major version update. Maybe others also have some ideas if backwards compatibility restrictions could be ignored.
The text was updated successfully, but these errors were encountered:
I think
massiv
is a great library and delivers great performance. However, I believe it is also very hard to use due to the complicated types. Here are some rather radical ideas which might improve the situation.Seq
everywhere which is usually the right choice. If parallel computation is desired,Par
should be specified when computing.'
at the end. I think the partial functions should be the default ones; indexing/dimension errors are usually programming errors.makeArray
and other generation functions return delayed arrays to aid type inference and make it less confusing.OverloadedRecordDot
forIxN
andSzN
to get the individual coordinatesData.Massiv.Array
is very long and it is often hard to find the right functions. Maybe put theM
variants in a different place and have a separate docs for them (e.g.Data.Massiv.Array.Safe
).Dimension n
andDim
, i.e. provide a constructor forDimension
that is not checked.index
,read
with a partial function. I would imagine that many people use them in combination withfromJust
.Please feel free to tell me what you think about these changes. Not all of them might be good but I included them to be thought-provoking.
These changes are obviously breaking changes and would need a major version update. Maybe others also have some ideas if backwards compatibility restrictions could be ignored.
The text was updated successfully, but these errors were encountered: