I am implementing the kNN algorithm in Haskell. I therefore need distance functions. The first one works well
import Data.Composition
import Data.Vector
taxicab :: Num a => Vector a -> Vector a -> a
taxicab = Data.Vector.sum .: Data.Vector.zipWith (\ x y -> abs $ x - y)
How can I create an alias Distance for Num a => Vector a -> Vector a -> a?
I could so write:
taxicab :: Distance