{-# LANGUAGE MultiParamTypeClasses #-} module Geom2d.Distance where import Geom2d.Point.Internal class Distance p q where distance :: (Ord a, Floating a) => p a -> q a -> a instance Distance Point' Point' where distance (Point' (a1,a2)) (Point' (b1,b2)) = sqrt $ (a1 - b1)^(2::Int) + (a2 - b2)^(2::Int)