From 9b566f2a63690b0adfcfd85d4b550bee46ad123e Mon Sep 17 00:00:00 2001 From: hasufell Date: Wed, 8 Oct 2014 22:07:37 +0200 Subject: [PATCH] Improve error handling --- Algorithms/ConvexHull.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Algorithms/ConvexHull.hs b/Algorithms/ConvexHull.hs index ad864af..3a36703 100644 --- a/Algorithms/ConvexHull.hs +++ b/Algorithms/ConvexHull.hs @@ -30,6 +30,7 @@ lowestYC (a:b:vs) -- P0 and the x-axis. grahamSort :: [PT] -- ^ the points to sort -> [PT] -- ^ sorted points +grahamSort [] = [] grahamSort xs = p0 : sortBy (\a b -> noEqual a b . compare @@ -59,7 +60,6 @@ grahamSort xs = p0 : sortBy (\a b grahamGetCH :: [PT] -> [PT] grahamGetCH vs = f . grahamSort $ vs where - f [] = [] f (x:y:z:xs) | ccw x y z = x : f (y:z:xs) | otherwise = f (x:z:xs)