Skip to content
Browse files

Added Numeric.Vector

  • Loading branch information...
1 parent bee734d commit b3e9cf522894e88398ff5f1c727e609bc8970248 @scravy committed Jan 17, 2014
Showing with 46 additions and 0 deletions.
  1. +46 −0 src/Numeric/Vector.hs
View
46 src/Numeric/Vector.hs
@@ -0,0 +1,46 @@
+{-# LANGUAGE Haskell2010
+ , TypeFamilies
+ , FlexibleContexts
+ , Trustworthy
+ #-}
+{-# OPTIONS -Wall -fno-warn-name-shadowing #-}
+
+module Numeric.Vector (
+
+ Vector
+
+) where
+
+
+data family Vector e
+
+
+data instance Matrix Int
+ = IntMatrix !Int (UArray Int Int)
+
+data instance Matrix Float
+ = FloatMatrix !Int (UArray Int Float)
+
+data instance Matrix Double
+ = DoubleMatrix !Int (UArray Int Double)
+
+data instance Matrix Integer
+ = IntegerMatrix !Int (Array Int Integer)
+
+data instance Matrix (Ratio a)
+ = RatioMatrix !Int (Array Int (Ratio a))
+
+data instance Matrix (Complex a)
+ = ComplexMatrix !Int (Array Int (Complex a))
+
+
+instance Typeable a => Typeable (Vector a) where
+ typeOf x = mkTyConApp (mkTyCon3 "bed-and-breakfast"
+ "Numeric.Vector"
+ "Vector") [typeOf (unT x)]
+ where
+ unT :: Matrix a -> a
+ unT = undefined
+
+
+

0 comments on commit b3e9cf5

Please sign in to comment.
Something went wrong with that request. Please try again.