From a6f2809ed7e245d5eee4704b152783b4672cc212 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Sat, 26 Apr 2025 10:02:38 +0200 Subject: Do away with ShowVia{ToListLinear,Primitive}, were unused --- src/Data/Array/Nested/Internal/Mixed.hs | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'src/Data/Array/Nested/Internal/Mixed.hs') 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 -- cgit v1.2.3-70-g09d2