aboutsummaryrefslogtreecommitdiff
path: root/src/Data/Array/Nested/Internal/Mixed.hs
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2025-04-26 10:02:38 +0200
committerTom Smeding <tom@tomsmeding.com>2025-04-26 10:04:01 +0200
commita6f2809ed7e245d5eee4704b152783b4672cc212 (patch)
treea30c8741344b74a1c115e2fd89ec9fa8b724132b /src/Data/Array/Nested/Internal/Mixed.hs
parent25d337c1b34192fedcd2496fe179acbd2051dd30 (diff)
Do away with ShowVia{ToListLinear,Primitive}, were unused
Diffstat (limited to 'src/Data/Array/Nested/Internal/Mixed.hs')
-rw-r--r--src/Data/Array/Nested/Internal/Mixed.hs18
1 files changed, 2 insertions, 16 deletions
diff --git a/src/Data/Array/Nested/Internal/Mixed.hs b/src/Data/Array/Nested/Internal/Mixed.hs
index 53b4f05..3bfda19 100644
--- a/src/Data/Array/Nested/Internal/Mixed.hs
+++ b/src/Data/Array/Nested/Internal/Mixed.hs
@@ -191,12 +191,8 @@ data instance MixedVecs s sh (a, b) = MV_Tup2 !(MixedVecs s sh a) !(MixedVecs s
data instance MixedVecs s sh1 (Mixed sh2 a) = MV_Nest !(IShX sh2) !(MixedVecs s (sh1 ++ sh2) a)
--- Helpers for Show instances for the Mixed arrays
-
-newtype ShowViaToListLinear sh a = ShowViaToListLinear (Mixed sh a)
-
-instance (Show a, Elt a) => Show (ShowViaToListLinear sh a) where
- showsPrec d (ShowViaToListLinear arr) = showParen (d > 10) $
+instance (Show a, Elt a) => Show (Mixed sh a) where
+ showsPrec d arr = showParen (d > 10) $
let defaultResult =
-- TODO: to avoid ambiguity, this should type-apply the shape to mfromListLinear
showString "mfromListLinear " . shows (shxToList (mshape arr)) . showString " "
@@ -209,16 +205,6 @@ instance (Show a, Elt a) => Show (ShowViaToListLinear sh a) where
. showsPrec 11 hd
else defaultResult
-newtype ShowViaPrimitive sh a = ShowViaPrimitive (Mixed sh (Primitive a))
-
-instance (Show a, Storable a) => Show (ShowViaPrimitive sh a) where
- showsPrec d (ShowViaPrimitive parr@(M_Primitive sh _)) = showParen (d > 10) $
- -- TODO: to avoid ambiguity, this should type-apply the shape to mfromListLinear
- showString "mfromListLinear " . shows (shxToList sh) . showString " "
- . shows (coerce @[Primitive a] @[a] (mtoListLinear parr))
-
-deriving via (ShowViaToListLinear sh a) instance (Show a, Elt a) => Show (Mixed sh a)
-
instance Elt a => NFData (Mixed sh a) where
rnf = mrnf