X-Git-Url: https://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FCardinal.hs;h=74a729fcda56c52865120da466ba9e38ddab2ea5;hb=HEAD;hp=9432d7e852a5a52d97c8941b0560f7d39354dee7;hpb=96fb8fc07b8f45e13b3aa545e0889ec50d957ab8;p=spline3.git diff --git a/src/Cardinal.hs b/src/Cardinal.hs index 9432d7e..d3a76b6 100644 --- a/src/Cardinal.hs +++ b/src/Cardinal.hs @@ -1,9 +1,3 @@ -{-# LANGUAGE NoMonomorphismRestriction #-} - --- --- Disable the MR so that let tp = testProperty does what it should! --- - -- | The Cardinal module contains the Cardinal data type, representing -- a cardinal direction (one of the 26 directions surrounding the -- center of a cube. In addition to those 26 directions, we also @@ -23,7 +17,18 @@ module Cardinal ( where import Control.Monad (liftM, liftM2) -import Prelude hiding (LT) +import Prelude ( + (.), + Bool, + Double, + Eq( (==), (/=) ), + Fractional( (/), fromRational, recip ), + Num( (+), (-), (*), abs, negate, signum, fromInteger ), + Show, + elem, + fromIntegral, + length, + return ) import Test.Tasty ( TestTree, testGroup ) import Test.Tasty.HUnit ( Assertion, assertEqual, testCase ) import Test.Tasty.QuickCheck ( @@ -265,22 +270,22 @@ test_c_tilde_2100_rotation_correct = assertEqual "auto-rotate equals manual rotate" ((ccwz . ccwz . cwy) expr1) expr2 where expr1 = - (3/8)*I + - (1/12)*(T + R + L + D) + - (1/64)*(FT + FR + FL + FD) + - (7/48)*F + - (1/48)*B + - (1/96)*(RT + LD + LT + RD) + - (1/192)*(BT + BR + BL + BD) + (3 / 8)*I + + (1 / 12)*(T + R + L + D) + + (1 / 64)*(FT + FR + FL + FD) + + (7 / 48)*F + + (1 / 48)*B + + (1 / 96)*(RT + LD + LT + RD) + + (1 / 192)*(BT + BR + BL + BD) expr2 = - (3/8)*I + - (1/12)*(F + L + R + B) + - (1/64)*(FT + LT + RT + BT) + - (7/48)*T + - (1/48)*D + - (1/96)*(FL + BR + FR + BL) + - (1/192)*(FD + LD + RD + BD) + (3 / 8)*I + + (1 / 12)*(F + L + R + B) + + (1 / 64)*(FT + LT + RT + BT) + + (7 / 48)*T + + (1 / 48)*D + + (1 / 96)*(FL + BR + FR + BL) + + (1 / 192)*(FD + LD + RD + BD) -- | A list of all directions, sans the interior and composite types. all_directions :: [Cardinal]