From 3824df2f2f17c8395832b88b27d61fdc22553f2e Mon Sep 17 00:00:00 2001 From: Sidharth Kapur Date: Sun, 13 Mar 2016 15:30:43 -0500 Subject: Simplify binary instances --- packages/base/src/Internal/Static.hs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'packages/base') diff --git a/packages/base/src/Internal/Static.hs b/packages/base/src/Internal/Static.hs index 1e9a5a3..058b9d0 100644 --- a/packages/base/src/Internal/Static.hs +++ b/packages/base/src/Internal/Static.hs @@ -69,21 +69,16 @@ instance NFData t => NFData (Dim n t) where -------------------------------------------------------------------------------- newtype R n = R (Dim n (Vector ℝ)) - deriving (Num,Fractional,Floating,Generic) + deriving (Num,Fractional,Floating,Generic,Binary) newtype C n = C (Dim n (Vector ℂ)) - deriving (Num,Fractional,Floating,Generic) + deriving (Num,Fractional,Floating,Generic,Binary) newtype L m n = L (Dim m (Dim n (Matrix ℝ))) - deriving (Generic) + deriving (Generic, Binary) newtype M m n = M (Dim m (Dim n (Matrix ℂ))) - deriving (Generic) - -instance (KnownNat n) => Binary (R n) -instance (KnownNat n) => Binary (C n) -instance (KnownNat m, KnownNat n) => Binary (L m n) -instance (KnownNat m, KnownNat n) => Binary (M m n) + deriving (Generic, Binary) mkR :: Vector ℝ -> R n mkR = R . Dim -- cgit v1.2.3