From 077d0442f576d3a1aeda12fa5141c34fbfbcd532 Mon Sep 17 00:00:00 2001 From: hasufell Date: Mon, 13 Oct 2014 22:30:19 +0200 Subject: [PATCH] ALGO: improve style --- Algorithms/ConvexHull/GrahamScan.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Algorithms/ConvexHull/GrahamScan.hs b/Algorithms/ConvexHull/GrahamScan.hs index 420376d..cb1d671 100644 --- a/Algorithms/ConvexHull/GrahamScan.hs +++ b/Algorithms/ConvexHull/GrahamScan.hs @@ -100,12 +100,12 @@ scanH :: [PT] -- ^ the first 3 starting points in reversed order -> [PT] -- ^ the rest of the points -> [[PT]] -- ^ all convex hull points iterations for the half scanH hs@(x:y:z:xs) (r':rs') - | notcw z y x = [hs] ++ scanH (r':hs) rs' - | otherwise = [hs] ++ scanH (x:z:xs) (r':rs') + | notcw z y x = hs : scanH (r':hs) rs' + | otherwise = hs : scanH (x:z:xs) (r':rs') scanH hs@(x:y:z:xs) [] | notcw z y x = [hs] - | otherwise = [hs] ++ scanH (x:z:xs) [] -scanH hs (r':rs') = [hs] ++ scanH (r':hs) rs' + | otherwise = hs : scanH (x:z:xs) [] +scanH hs (r':rs') = hs : scanH (r':hs) rs' scanH hs _ = [hs]