]> gitweb.michael.orlitzky.com - spline3.git/blob - src/Cardinal.hs
Add the Cardinal and FunctionValues modules which will hopefully replace the existing...
[spline3.git] / src / Cardinal.hs
1 module Cardinal
2 where
3
4 data Cardinal = F
5 | B
6 | L
7 | R
8 | T
9 | D
10 | Sum Cardinal Cardinal
11 | Difference Cardinal Cardinal
12 | Product Cardinal Cardinal
13 | ScalarProduct Double Cardinal
14 deriving (Show, Eq)
15
16 instance Num Cardinal where
17 x + y = Sum x y
18 x - y = Difference x y
19 x * y = Sum x y
20 negate x = ScalarProduct (-1) x
21 abs x = x
22 signum x = x
23 fromInteger _ = F -- Whatever.