1 2 3 4 5 6 7 8 9 10 | data Cartesian2D = Cartesian2D { xCoord :: Double, yCoord :: Double } deriving (Eq, Show) lowestCoord :: [Cartesian2D] -> Cartesian2D lowestCoord xs = minimumBy f xs where f a b = case (compare `on` yCoord) a b of EQ -> (compare `on` xCoord) a b x -> x |