Euclidean norm in Haskell & Scala