]> gitweb.michael.orlitzky.com - spline3.git/blobdiff - src/Cardinal.hs
Fix two minor documentation issues.
[spline3.git] / src / Cardinal.hs
index 42b1260bb13f72f530bd725fd89943da1c1d004f..9bd8e1df933b592d877d2e1efe810b44d96092ac 100644 (file)
@@ -1,6 +1,6 @@
 -- | The Cardinal module contains the Cardinal data type, representing
---   a cardinal direction (one of the 27 directions surrounding the
---   center of a cube. In addition to those 27 directions, we also
+--   a cardinal direction (one of the 26 directions surrounding the
+--   center of a cube. In addition to those 26 directions, we also
 --   include the interior point and a number of composite types that
 --   allow us to perform arithmetic on directions.
 module Cardinal
@@ -46,7 +46,7 @@ data Cardinal = F   -- ^ Front
                 deriving (Show, Eq)
 
 
--- | By making Cardinal an instance of Num, we gain the ability to
+-- | By making Cardinal an instance of 'Num', we gain the ability to
 --   add, subtract, and multiply directions. The results of these
 --   operations are never actually calculated; the types just keep
 --   track of which operations were performed in which order.
@@ -54,17 +54,17 @@ instance Num Cardinal where
     x + y = Sum x y
     x - y = Difference x y
     x * y = Product x y
-    negate x = Product (Scalar (-1)) x
+    negate = Product (Scalar (-1))
     abs x = x
     signum x = x
     fromInteger x = Scalar (fromIntegral x)
 
 
--- | Like the Num instance, the Fractional instance allows us to
+-- | Like the Num instance, the 'Fractional' instance allows us to
 --   take quotients of directions.
 instance Fractional Cardinal where
     x / y   = Quotient x y
-    recip x = Quotient (Scalar 1) x
+    recip = Quotient (Scalar 1)
     fromRational x = Scalar (fromRational x)