Improve error handling

This commit is contained in:
hasufell 2014-10-08 22:07:37 +02:00
parent 2fa1204d82
commit 9b566f2a63
No known key found for this signature in database
GPG Key ID: 220CD1C5BDEED020

View File

@ -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)