on master help sign in
distinct Module instance for matrices
e612c84Cliff Harvey
libs/base/Data/Matrix.idr+4
@@ -42,6 +42,10 @@ instance Field a => Field (Vect n a) where
42instance RingWithUnity a => Module a (Vect n a) where
42instance RingWithUnity a => Module a (Vect n a) where
43 (<#>) r v = map (r <*>) v
43 (<#>) r v = map (r <*>) v
44
44
45+instance RingWithUnity a => Module a (Vect n (Vect l a)) where
46+ (<#>) r m = map (r <#>) m
47+-- should be Module a b => Module a (Vect n b), but results in 'overlapping instance'
48+
45-----------------------------------------------------------------------
49-----------------------------------------------------------------------
46-- (Ring) Vector functions
50-- (Ring) Vector functions
47-----------------------------------------------------------------------
51-----------------------------------------------------------------------