4 ms·
> Are there any type systems that work well for the array programming problem domain? Do a search for "haskell strongly typed tensor programming."
by thesz 3y ago
> Are there any type systems that work well for the array programming problem domain?
Do a search for "haskell strongly typed tensor programming."
- tome 3y agoOr just look at Orthotope: https://hackage.haskell.org/package/orthotope https://hackage.haskell.org/package/orthotope "Multidimensional arrays inspired by APL"
- dan-robertson 3y agoI don’t understand how to express the type of + with the shaped api. The examples are either operating on equal shapes or take advantage of fromInteger to multiply by a scalar. One could write eg add x y = broadcast x + broadcast y, but that now allows + to output arrays with arbitrary extra outer dimensions, whereas an apl + rejects some inputs but has an output shape that is a deterministic function of the input shapes
- tome 3y agoIf you tell me what + should do then maybe I can help. Does it broadcast to the higher-dimensional of the two arguments?