X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FCardinal.hs;h=b911003b7d6cfaedff1f31ba6179208422c6c6b4;hb=58cf11569acb270995d2de924dda03ef526647e2;hp=42b1260bb13f72f530bd725fd89943da1c1d004f;hpb=084d6e31ba1eda1e7c206ff8ff23e8567e2339ce;p=spline3.git diff --git a/src/Cardinal.hs b/src/Cardinal.hs index 42b1260..b911003 100644 --- a/src/Cardinal.hs +++ b/src/Cardinal.hs @@ -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,7 +54,7 @@ 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) @@ -64,7 +64,7 @@ instance Num Cardinal where -- 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)