From faa248b515b756ad2457f6dbf595f119703bca4b Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Mon, 10 Jun 2024 22:05:58 +0200 Subject: Conciseness cleanup --- src/Data/Array/Mixed/Internal/Arith.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Data') 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 = -- cgit v1.2.3-70-g09d2