I have a question I want to do the addition of 2 matrix by row in erlang, I'm trying to apply the code for Haskell:
add :: Num a => [[a]] -> [[a]] -> [[a]]
add = zipWith $ zipWith (+)
I did something like this:
add([[]],[[]]) -> []
add = zipWith $ zipWith (+)
but it get's an error, with the $, I'm really confused. How can I do this in erlang?
And works in this way:
add([[ 1, 2 ],[ 3 , 4 ]] , [[ 4 , 5 ],[ 6 , 7 ]] ).
Result:
[[ 6, 8], [ 10, 12]]