aboutsummaryrefslogtreecommitdiff
path: root/src/Data/Array/Mixed
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2024-06-10 22:05:58 +0200
committerTom Smeding <tom@tomsmeding.com>2024-06-10 22:05:58 +0200
commitfaa248b515b756ad2457f6dbf595f119703bca4b (patch)
tree14cc01d4822a8b7cf272e69ad60664ddf2e4747d /src/Data/Array/Mixed
parent19e24848768a80fd971292bf93b9d1769a5118e4 (diff)
Conciseness cleanup
Diffstat (limited to 'src/Data/Array/Mixed')
-rw-r--r--src/Data/Array/Mixed/Internal/Arith.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Data/Array/Mixed/Internal/Arith.hs b/src/Data/Array/Mixed/Internal/Arith.hs
index 98acfb9..0b9b8eb 100644
--- a/src/Data/Array/Mixed/Internal/Arith.hs
+++ b/src/Data/Array/Mixed/Internal/Arith.hs
@@ -171,8 +171,8 @@ vectorRedInnerOp :: forall a b n. (Num a, Storable a)
-> RS.Array (n + 1) a -> RS.Array n a
vectorRedInnerOp sn@SNat valconv ptrconv fscale fred (RS.A (RG.A sh (OI.T strides offset vec)))
| null sh = error "unreachable"
- | last sh <= 0 = RS.stretch (init sh) (RS.fromList (map (const 1) (init sh)) [0])
- | any (<= 0) (init sh) = RS.A (RG.A (init sh) (OI.T (map (const 0) (init strides)) 0 VS.empty))
+ | last sh <= 0 = RS.stretch (init sh) (RS.fromList (1 <$ init sh) [0])
+ | any (<= 0) (init sh) = RS.A (RG.A (init sh) (OI.T (0 <$ init strides) 0 VS.empty))
-- now the input array is nonempty
| last sh == 1 = RS.A (RG.A (init sh) (OI.T (init strides) offset vec))
| last strides == 0 =