im new to haskell and i have to do a function that takes a list and calculates the distance recursively.
For example:
distance [(0,0),(2,0),(2,5)]
->7
distance [(1,1),(3,4)]
->3.6055512
I made the distance between just two points like this
distance (x1 , y1) (x2 , y2) = sqrt
(x'*x' + y'*y')
where
x' = x1 - x2
y' = y1 - y2
But dont know how do to it with a variable list size, thanks