-{-# 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
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 (
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]