module TwoTuple
where
-import Vector
+import Normed
data TwoTuple a = TwoTuple a a
instance Functor TwoTuple where
f `fmap` (TwoTuple x1 y1) = TwoTuple (f x1) (f y1)
-instance (RealFloat a) => Vector (TwoTuple a) where
+instance (RealFloat a) => Normed (TwoTuple a) where
-- The standard Euclidean 2-norm. We need RealFloat for the square
-- root.
- norm_2 (TwoTuple x y) = fromRational $ toRational (sqrt(x^2 + y^2))
+ norm (TwoTuple x y) = fromRational $ toRational (sqrt(x^2 + y^2))
-- The infinity norm, i.e. the maximum entry.
norm_infty (TwoTuple x y) =