diff options
author | Sidharth Kapur <sidharthkapur1@gmail.com> | 2016-03-13 15:30:43 -0500 |
---|---|---|
committer | Sidharth Kapur <sidharthkapur1@gmail.com> | 2016-03-13 15:30:43 -0500 |
commit | 3824df2f2f17c8395832b88b27d61fdc22553f2e (patch) | |
tree | 06492b0c6f02ab5c0aa1106b7e845b6e18a92c2d /packages/base/src | |
parent | 1b39d2227606523441d918735d467f73b6cf23cc (diff) |
Simplify binary instances
Diffstat (limited to 'packages/base/src')
-rw-r--r-- | packages/base/src/Internal/Static.hs | 13 |
1 files changed, 4 insertions, 9 deletions
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 | |||
69 | -------------------------------------------------------------------------------- | 69 | -------------------------------------------------------------------------------- |
70 | 70 | ||
71 | newtype R n = R (Dim n (Vector ℝ)) | 71 | newtype R n = R (Dim n (Vector ℝ)) |
72 | deriving (Num,Fractional,Floating,Generic) | 72 | deriving (Num,Fractional,Floating,Generic,Binary) |
73 | 73 | ||
74 | newtype C n = C (Dim n (Vector ℂ)) | 74 | newtype C n = C (Dim n (Vector ℂ)) |
75 | deriving (Num,Fractional,Floating,Generic) | 75 | deriving (Num,Fractional,Floating,Generic,Binary) |
76 | 76 | ||
77 | newtype L m n = L (Dim m (Dim n (Matrix ℝ))) | 77 | newtype L m n = L (Dim m (Dim n (Matrix ℝ))) |
78 | deriving (Generic) | 78 | deriving (Generic, Binary) |
79 | 79 | ||
80 | newtype M m n = M (Dim m (Dim n (Matrix ℂ))) | 80 | newtype M m n = M (Dim m (Dim n (Matrix ℂ))) |
81 | deriving (Generic) | 81 | deriving (Generic, Binary) |
82 | |||
83 | instance (KnownNat n) => Binary (R n) | ||
84 | instance (KnownNat n) => Binary (C n) | ||
85 | instance (KnownNat m, KnownNat n) => Binary (L m n) | ||
86 | instance (KnownNat m, KnownNat n) => Binary (M m n) | ||
87 | 82 | ||
88 | mkR :: Vector ℝ -> R n | 83 | mkR :: Vector ℝ -> R n |
89 | mkR = R . Dim | 84 | mkR = R . Dim |