3 ms·
I guess I still fail to see the advantage of this over Haskell: dot = (sum.) . zipWith (\*) p = [2, 3, 4] q = [1, 0, 2] p `dot` q Like, the on
by akavi 3y ago
I guess I still fail to see the advantage of this over Haskell:
dot = (sum.) . zipWith (\*)
p = [2, 3, 4]
q = [1, 0, 2]
p `dot` q
Like, the only difference to my eyes is using names for sum/zipWith, and not having the lifts/restructuring happen "magically"
- RodgerTheGreat 3y agoThe APL/J/K/Klong versions are more general; they all work for a variety of ranks of input, whereas the Haskell version- which is the longest and most visually noisy- bakes in a single rank's mapping explicitly.
- radiator 3y agoWell, for one, your Haskell version is obviously much longer.
- dr_kiszonka 3y agoHaha!