aboutsummaryrefslogtreecommitdiff
path: root/src/Data/Array
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2024-05-13 19:39:17 +0200
committerTom Smeding <tom@tomsmeding.com>2024-05-13 19:39:17 +0200
commit8a8a9eda7af43770f35b7f1078566d388b34b9a7 (patch)
tree85faf9cde2b489c8c85f655e0feaf9068465256a /src/Data/Array
parent89b5f323d9e5cd7b44e1706c9bfc239045af577a (diff)
Remove some redundant 'case'
Diffstat (limited to 'src/Data/Array')
-rw-r--r--src/Data/Array/Nested/Internal.hs20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/Data/Array/Nested/Internal.hs b/src/Data/Array/Nested/Internal.hs
index 78d3760..6f22e59 100644
--- a/src/Data/Array/Nested/Internal.hs
+++ b/src/Data/Array/Nested/Internal.hs
@@ -900,9 +900,8 @@ infixr 3 :.:
data UnconsIxRRes i n1 =
forall n. ((S n) ~ n1) => UnconsIxRRes (IxR n i) i
unconsIxR :: IxR n1 i -> Maybe (UnconsIxRRes i n1)
-unconsIxR (IxR sh) = case sh of
- i ::: sh' -> Just (UnconsIxRRes (IxR sh') i)
- ZR -> Nothing
+unconsIxR (IxR (i ::: sh')) = Just (UnconsIxRRes (IxR sh') i)
+unconsIxR (IxR ZR) = Nothing
type IIxR n = IxR n Int
@@ -933,9 +932,8 @@ infixr 3 :$:
data UnconsShRRes i n1 =
forall n. S n ~ n1 => UnconsShRRes (ShR n i) i
unconsShR :: ShR n1 i -> Maybe (UnconsShRRes i n1)
-unconsShR (ShR sh) = case sh of
- i ::: sh' -> Just (UnconsShRRes (ShR sh') i)
- ZR -> Nothing
+unconsShR (ShR (i ::: sh')) = Just (UnconsShRRes (ShR sh') i)
+unconsShR (ShR ZR) = Nothing
knownShR :: ShR n i -> Dict KnownINat n
knownShR (ShR sh) = knownListR sh
@@ -1120,9 +1118,8 @@ infixr 3 :.$
data UnconsIxSRes i sh1 =
forall n sh. (n : sh ~ sh1) => UnconsIxSRes (IxS sh i) i
unconsIxS :: IxS sh1 i -> Maybe (UnconsIxSRes i sh1)
-unconsIxS (IxS shl) = case shl of
- i ::$ shl' -> Just (UnconsIxSRes (IxS shl') i)
- ZS -> Nothing
+unconsIxS (IxS (i ::$ shl')) = Just (UnconsIxSRes (IxS shl') i)
+unconsIxS (IxS ZS) = Nothing
type IIxS sh = IxS sh Int
@@ -1150,9 +1147,8 @@ infixr 3 :$$
data UnconsShSRes i sh1 =
forall n sh. (n : sh ~ sh1) => UnconsShSRes (ShS sh i) i
unconsShS :: ShS sh1 i -> Maybe (UnconsShSRes i sh1)
-unconsShS (ShS shl) = case shl of
- i ::$ shl' -> Just (UnconsShSRes (ShS shl') i)
- ZS -> Nothing
+unconsShS (ShS (i ::$ shl')) = Just (UnconsShSRes (ShS shl') i)
+unconsShS (ShS ZS) = Nothing
zeroIxS :: SShape sh -> IIxS sh
zeroIxS ShNil = ZIS