From 7cee33b2fa4789525a12685923edf1f38924a7f4 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Wed, 15 Apr 2015 21:13:28 -0400 Subject: [PATCH] Whitespace and import cleanup in Cube. --- src/Cube.hs | 48 +++++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/src/Cube.hs b/src/Cube.hs index 7fce975..6e33423 100644 --- a/src/Cube.hs +++ b/src/Cube.hs @@ -3,11 +3,10 @@ module Cube ( cube_properties, find_containing_tetrahedron, tetrahedra, - tetrahedron - ) + tetrahedron ) where -import Data.Maybe (fromJust) +import Data.Maybe ( fromJust ) import qualified Data.Vector as V ( Vector, findIndex, @@ -15,21 +14,26 @@ import qualified Data.Vector as V ( minimum, singleton, snoc, - unsafeIndex - ) - -import Prelude hiding (LT) -import Test.Framework (Test, testGroup) -import Test.Framework.Providers.QuickCheck2 (testProperty) -import Test.QuickCheck (Arbitrary(..), Gen, Positive(..), choose) - -import Cardinal -import Comparisons ((~=), (~~=)) -import qualified Face (Face(..), center) -import FunctionValues (FunctionValues, eval, rotate) -import Misc (all_equal, disjoint) -import Point (Point(..), dot) -import Tetrahedron (Tetrahedron(..), barycenter, c, volume) + unsafeIndex) +import Prelude hiding ( LT ) +import Test.Framework ( Test, testGroup ) +import Test.Framework.Providers.QuickCheck2 ( testProperty ) +import Test.QuickCheck ( Arbitrary(..), Gen, Positive(..), choose ) + +import Cardinal ( + Cardinal(..), + ccwx, + ccwy, + ccwz, + cwx, + cwy, + cwz ) +import Comparisons ( (~=), (~~=) ) +import qualified Face ( Face(..), center ) +import FunctionValues ( FunctionValues, eval, rotate ) +import Misc ( all_equal, disjoint ) +import Point ( Point(..), dot ) +import Tetrahedron ( Tetrahedron(..), barycenter, c, volume ) data Cube = Cube { i :: !Int, j :: !Int, @@ -604,9 +608,8 @@ find_containing_tetrahedron cube p = left_half = in_left_half cube p candidates :: V.Vector Tetrahedron - candidates = - if front_half then - + candidates + | front_half = if left_half then if top_half then front_left_top_tetrahedra cube @@ -618,8 +621,7 @@ find_containing_tetrahedron cube p = else front_right_down_tetrahedra cube - else -- bottom half - + | otherwise = -- back half if left_half then if top_half then back_left_top_tetrahedra cube -- 2.44.2