From 8fe477ce386f1b9c092e5cebfee440b5542b64a3 Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Mon, 11 Jan 2016 21:24:02 +0100 Subject: provisional fix for takeDiag --- packages/base/src/Numeric/LinearAlgebra/Static.hs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'packages/base') diff --git a/packages/base/src/Numeric/LinearAlgebra/Static.hs b/packages/base/src/Numeric/LinearAlgebra/Static.hs index 720b011..1ab7e57 100644 --- a/packages/base/src/Numeric/LinearAlgebra/Static.hs +++ b/packages/base/src/Numeric/LinearAlgebra/Static.hs @@ -225,19 +225,14 @@ class Diag m d | m -> d takeDiag :: m -> d -instance forall n . (KnownNat n) => Diag (L n n) (R n) +instance KnownNat n => Diag (L n n) (R n) where - takeDiag m = mkR (LA.takeDiag (extract m)) + takeDiag x = mkR (LA.takeDiag (extract x)) -instance forall m n . (KnownNat m, KnownNat n, m <= n+1) => Diag (L m n) (R m) +instance KnownNat n => Diag (M n n) (C n) where - takeDiag m = mkR (LA.takeDiag (extract m)) - - -instance forall m n . (KnownNat m, KnownNat n, n <= m+1) => Diag (L m n) (R n) - where - takeDiag m = mkR (LA.takeDiag (extract m)) + takeDiag x = mkC (LA.takeDiag (extract x)) -------------------------------------------------------------------------------- -- cgit v1.2.3