]> gitweb.michael.orlitzky.com - numerical-analysis.git/blobdiff - src/Vector.hs
Replace the custom 'Vector' typeclass with 'Normed' everywhere.
[numerical-analysis.git] / src / Vector.hs
diff --git a/src/Vector.hs b/src/Vector.hs
deleted file mode 100644 (file)
index 6953031..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-{-# LANGUAGE FlexibleInstances #-}
-
--- | The 'Vector' class represents elements of a normed vector
---   space. We define instances for all common numeric types.
-module Vector
-where
-
-import Data.Number.BigFloat
-
-class (Num a) => Vector a where
-  norm_2 :: RealFrac b => a -> b
-  norm_infty :: RealFrac b => a -> b
-
--- Define instances for common numeric types.
-instance Vector Integer where
-  norm_2 = fromInteger
-  norm_infty = fromInteger
-
-instance Vector Rational where
-  norm_2 = fromRational
-  norm_infty = fromRational
-
-instance Epsilon e => Vector (BigFloat e) where
-  norm_2 = fromRational . toRational
-  norm_infty = fromRational . toRational
-
-instance Vector Double where
-  norm_2 = fromRational . toRational
-  norm_infty = fromRational . toRational