diff options
author | Tom Smeding <tom@tomsmeding.com> | 2025-05-16 10:42:24 +0200 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2025-05-16 11:21:51 +0200 |
commit | 09041ca155485885a2f337f71b04442e991a550d (patch) | |
tree | 82c05989d2be6d87ca96aa7467f3162bf2d5698b /src/Data/Array/Nested/Ranked/Shape.hs | |
parent | 8890526cac9e6c4d5583d00fce55f32ba613cf31 (diff) |
default-show-instances flag
Diffstat (limited to 'src/Data/Array/Nested/Ranked/Shape.hs')
-rw-r--r-- | src/Data/Array/Nested/Ranked/Shape.hs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/Data/Array/Nested/Ranked/Shape.hs b/src/Data/Array/Nested/Ranked/Shape.hs index 1c0b9eb..c18f9ee 100644 --- a/src/Data/Array/Nested/Ranked/Shape.hs +++ b/src/Data/Array/Nested/Ranked/Shape.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE DeriveFunctor #-} @@ -54,8 +55,12 @@ deriving instance Functor (ListR n) deriving instance Foldable (ListR n) infixr 3 ::: +#ifdef OXAR_DEFAULT_SHOW_INSTANCES +deriving instance Show i => Show (ListR n i) +#else instance Show i => Show (ListR n i) where showsPrec _ = listrShow shows +#endif instance NFData i => NFData (ListR n i) where rnf ZR = () @@ -189,8 +194,12 @@ infixr 3 :.: type IIxR n = IxR n Int +#ifdef OXAR_DEFAULT_SHOW_INSTANCES +deriving instance Show i => Show (IxR n i) +#else instance Show i => Show (IxR n i) where showsPrec _ (IxR l) = listrShow shows l +#endif instance NFData i => NFData (IxR sh i) @@ -260,8 +269,12 @@ infixr 3 :$: type IShR n = ShR n Int +#ifdef OXAR_DEFAULT_SHOW_INSTANCES +deriving instance Show i => Show (ShR n i) +#else instance Show i => Show (ShR n i) where showsPrec _ (ShR l) = listrShow shows l +#endif instance NFData i => NFData (ShR sh i) |