on master help sign in
Use Hlint's <$> suggestion judiciously
97523d9pranaysashank
src/Streamly/Internal/Memory/Array/Types.hs+6−3
@@ -1145,7 +1145,8 @@ lpackArraysChunksOf n (Fold step1 initial1 extract1) =
1145 -- XXX we can pass the module string from the higher level API
1145 -- XXX we can pass the module string from the higher level API
1146 error $ "Streamly.Internal.Memory.Array.Types.packArraysChunksOf: the size of "
1146 error $ "Streamly.Internal.Memory.Array.Types.packArraysChunksOf: the size of "
1147 ++ "arrays [" ++ show n ++ "] must be a natural number"
1147 ++ "arrays [" ++ show n ++ "] must be a natural number"
1148+ r1 <- initial1
1148− Tuple' Nothing <$> initial1
1149+ return (Tuple' Nothing r1)
1149
1150
1150 extract (Tuple' Nothing r1) = extract1 r1
1151 extract (Tuple' Nothing r1) = extract1 r1
1151 extract (Tuple' (Just buf) r1) = do
1152 extract (Tuple' (Just buf) r1) = do
@@ -1158,7 +1159,8 @@ lpackArraysChunksOf n (Fold step1 initial1 extract1) =
1158 then do
1159 then do
1159 r <- step1 r1 arr
1160 r <- step1 r1 arr
1160 extract1 r
1161 extract1 r
1162+ r1' <- initial1
1161− Tuple' Nothing <$> initial1
1163+ return (Tuple' Nothing r1')
1162 else return (Tuple' (Just arr) r1)
1164 else return (Tuple' (Just arr) r1)
1163
1165
1164 step (Tuple' (Just buf) r1) arr = do
1166 step (Tuple' (Just buf) r1) arr = do
@@ -1172,7 +1174,8 @@ lpackArraysChunksOf n (Fold step1 initial1 extract1) =
1172 then do
1174 then do
1173 r <- step1 r1 buf''
1175 r <- step1 r1 buf''
1174 extract1 r
1176 extract1 r
1177+ r1' <- initial1
1175− Tuple' Nothing <$> initial1
1178+ return (Tuple' Nothing r1')
1176 else return (Tuple' (Just buf'') r1)
1179 else return (Tuple' (Just buf'') r1)
1177
1180
1178#if !defined(mingw32_HOST_OS)
1181#if !defined(mingw32_HOST_OS)