From c864b66c83f2be395fa590321ca313e227d79fab Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 8 Jul 2011 17:26:38 -0400 Subject: [PATCH] Fix some hlint warnings. --- src/Grid.hs | 4 ++-- src/Misc.hs | 2 +- src/Tests/Cube.hs | 48 ++++++++++++++++++++-------------------- src/Tests/Tetrahedron.hs | 24 ++++++++++---------- 4 files changed, 39 insertions(+), 39 deletions(-) diff --git a/src/Grid.hs b/src/Grid.hs index 4b75185..e45a0f4 100644 --- a/src/Grid.hs +++ b/src/Grid.hs @@ -42,8 +42,8 @@ cubes g where fvs = function_values g zsize = (length fvs) - 1 - ysize = (length $ head fvs) - 1 - xsize = (length $ head $ head fvs) - 1 + ysize = length (head fvs) - 1 + xsize = length (head $ head fvs) - 1 -- | Takes a grid and a position as an argument and returns the cube diff --git a/src/Misc.hs b/src/Misc.hs index fd6dd39..b2ebeef 100644 --- a/src/Misc.hs +++ b/src/Misc.hs @@ -24,7 +24,7 @@ flatten xs = concat $ concat xs -- equal. Returns False otherwise. all_equal :: (Eq a) => [a] -> Bool all_equal xs = - and $ map (== first_element) other_elements + all (== first_element) other_elements where first_element = head xs other_elements = tail xs diff --git a/src/Tests/Cube.hs b/src/Tests/Cube.hs index a772f4b..e867e5d 100644 --- a/src/Tests/Cube.hs +++ b/src/Tests/Cube.hs @@ -714,30 +714,30 @@ prop_interior_values_all_identical cube = i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23] where - i0 = eval (Tetrahedron.fv (tetrahedron0 cube)) $ I - i1 = eval (Tetrahedron.fv (tetrahedron1 cube)) $ I - i2 = eval (Tetrahedron.fv (tetrahedron2 cube)) $ I - i3 = eval (Tetrahedron.fv (tetrahedron3 cube)) $ I - i4 = eval (Tetrahedron.fv (tetrahedron4 cube)) $ I - i5 = eval (Tetrahedron.fv (tetrahedron5 cube)) $ I - i6 = eval (Tetrahedron.fv (tetrahedron6 cube)) $ I - i7 = eval (Tetrahedron.fv (tetrahedron7 cube)) $ I - i8 = eval (Tetrahedron.fv (tetrahedron8 cube)) $ I - i9 = eval (Tetrahedron.fv (tetrahedron9 cube)) $ I - i10 = eval (Tetrahedron.fv (tetrahedron10 cube)) $ I - i11 = eval (Tetrahedron.fv (tetrahedron11 cube)) $ I - i12 = eval (Tetrahedron.fv (tetrahedron12 cube)) $ I - i13 = eval (Tetrahedron.fv (tetrahedron13 cube)) $ I - i14 = eval (Tetrahedron.fv (tetrahedron14 cube)) $ I - i15 = eval (Tetrahedron.fv (tetrahedron15 cube)) $ I - i16 = eval (Tetrahedron.fv (tetrahedron16 cube)) $ I - i17 = eval (Tetrahedron.fv (tetrahedron17 cube)) $ I - i18 = eval (Tetrahedron.fv (tetrahedron18 cube)) $ I - i19 = eval (Tetrahedron.fv (tetrahedron19 cube)) $ I - i20 = eval (Tetrahedron.fv (tetrahedron20 cube)) $ I - i21 = eval (Tetrahedron.fv (tetrahedron21 cube)) $ I - i22 = eval (Tetrahedron.fv (tetrahedron22 cube)) $ I - i23 = eval (Tetrahedron.fv (tetrahedron23 cube)) $ I + i0 = eval (Tetrahedron.fv (tetrahedron0 cube)) I + i1 = eval (Tetrahedron.fv (tetrahedron1 cube)) I + i2 = eval (Tetrahedron.fv (tetrahedron2 cube)) I + i3 = eval (Tetrahedron.fv (tetrahedron3 cube)) I + i4 = eval (Tetrahedron.fv (tetrahedron4 cube)) I + i5 = eval (Tetrahedron.fv (tetrahedron5 cube)) I + i6 = eval (Tetrahedron.fv (tetrahedron6 cube)) I + i7 = eval (Tetrahedron.fv (tetrahedron7 cube)) I + i8 = eval (Tetrahedron.fv (tetrahedron8 cube)) I + i9 = eval (Tetrahedron.fv (tetrahedron9 cube)) I + i10 = eval (Tetrahedron.fv (tetrahedron10 cube)) I + i11 = eval (Tetrahedron.fv (tetrahedron11 cube)) I + i12 = eval (Tetrahedron.fv (tetrahedron12 cube)) I + i13 = eval (Tetrahedron.fv (tetrahedron13 cube)) I + i14 = eval (Tetrahedron.fv (tetrahedron14 cube)) I + i15 = eval (Tetrahedron.fv (tetrahedron15 cube)) I + i16 = eval (Tetrahedron.fv (tetrahedron16 cube)) I + i17 = eval (Tetrahedron.fv (tetrahedron17 cube)) I + i18 = eval (Tetrahedron.fv (tetrahedron18 cube)) I + i19 = eval (Tetrahedron.fv (tetrahedron19 cube)) I + i20 = eval (Tetrahedron.fv (tetrahedron20 cube)) I + i21 = eval (Tetrahedron.fv (tetrahedron21 cube)) I + i22 = eval (Tetrahedron.fv (tetrahedron22 cube)) I + i23 = eval (Tetrahedron.fv (tetrahedron23 cube)) I -- | We know what (c t6 2 1 0 0) should be from Sorokina and Zeilfelder, p. 87. diff --git a/src/Tests/Tetrahedron.hs b/src/Tests/Tetrahedron.hs index 18fe2ba..5e17671 100644 --- a/src/Tests/Tetrahedron.hs +++ b/src/Tests/Tetrahedron.hs @@ -305,8 +305,8 @@ prop_x_rotation_doesnt_affect_front t = where fv0 = Tetrahedron.fv t fv1 = rotate (Tetrahedron.fv t) cwx - expr1 = front $ fv0 - expr2 = front $ fv1 + expr1 = front fv0 + expr2 = front fv1 prop_x_rotation_doesnt_affect_back :: Tetrahedron -> Bool prop_x_rotation_doesnt_affect_back t = @@ -314,8 +314,8 @@ prop_x_rotation_doesnt_affect_back t = where fv0 = Tetrahedron.fv t fv1 = rotate (Tetrahedron.fv t) cwx - expr1 = back $ fv0 - expr2 = back $ fv1 + expr1 = back fv0 + expr2 = back fv1 prop_y_rotation_doesnt_affect_left :: Tetrahedron -> Bool @@ -324,8 +324,8 @@ prop_y_rotation_doesnt_affect_left t = where fv0 = Tetrahedron.fv t fv1 = rotate (Tetrahedron.fv t) cwy - expr1 = left $ fv0 - expr2 = left $ fv1 + expr1 = left fv0 + expr2 = left fv1 prop_y_rotation_doesnt_affect_right :: Tetrahedron -> Bool prop_y_rotation_doesnt_affect_right t = @@ -333,8 +333,8 @@ prop_y_rotation_doesnt_affect_right t = where fv0 = Tetrahedron.fv t fv1 = rotate (Tetrahedron.fv t) cwy - expr1 = right $ fv0 - expr2 = right $ fv1 + expr1 = right fv0 + expr2 = right fv1 prop_z_rotation_doesnt_affect_down :: Tetrahedron -> Bool @@ -343,8 +343,8 @@ prop_z_rotation_doesnt_affect_down t = where fv0 = Tetrahedron.fv t fv1 = rotate (Tetrahedron.fv t) cwz - expr1 = down $ fv0 - expr2 = down $ fv1 + expr1 = down fv0 + expr2 = down fv1 prop_z_rotation_doesnt_affect_top :: Tetrahedron -> Bool @@ -353,8 +353,8 @@ prop_z_rotation_doesnt_affect_top t = where fv0 = Tetrahedron.fv t fv1 = rotate (Tetrahedron.fv t) cwz - expr1 = top $ fv0 - expr2 = top $ fv1 + expr1 = top fv0 + expr2 = top fv1 prop_swapping_vertices_doesnt_affect_coefficients1 :: Tetrahedron -> Bool prop_swapping_vertices_doesnt_affect_coefficients1 t = -- 2.43.2