If arrays are functions, I suppose named parameters are named axes.
Conversation
In numpy, `a + b` for arrays is fine. Can't do that with functions, of course. But could be cool. Seems like that's multiple point free programming with auto alignment. What's the most straightforward equivalent in Haskell for functions?
1
2
For example, given `a x = x + 1` and `b x = 2 * x`, I can't just get a new function by saying `a + b`. But what's closest in feel to this that works?
3
Wouldn't that just be:
`map (a . b) xs`
Ofc, order matters, those are not commutative.
1
In this case, I want to add the result of two functions, not compose them. Could swap out `a x = a ^ 3` for a better example to keep addition separate. But `\x -> (a x) + (b x)` isn't the same as `a . b`
1
Found from the Haskell wiki that `liftM2 (+) a b` does the trick, even if not as succinctly as `a + b`
2
I wonder if you could use idiom brackets for this… maybe: `[| a + b |]`
- idris2.readthedocs.io/en/latest/tuto
- staff.city.ac.uk/~ross/papers/A


