Say I defined this type: type Pos = (Int, Int)
I'd like to use above type to calculate thhe distance between two points, and I wrote like this:
type Pos = (Int, Int)
distancee :: Pos -> Pos -> Float
distancee Pos (x1,y1) (x2,y2) = sqrt((dx*dx)+(dy*dy))
where
dx = x2 - x1
dy = y2 - y1
I dont really know how to use Pos, and above is not right, so could you please tell me how can I fix that?