@@ -1145,7 +1145,8 @@ lpackArraysChunksOf n (Fold step1 initial1 extract1) =
11451145 -- XXX we can pass the module string from the higher level API
11461146 error $ "Streamly.Internal.Memory.Array.Types.packArraysChunksOf: the size of "
11471147 ++ "arrays [" ++ show n ++ "] must be a natural number"
1148− Tuple' Nothing <$> initial1
1148+ r1 <- initial1
1149+ return (Tuple' Nothing r1)
11491150
11501151 extract (Tuple' Nothing r1) = extract1 r1
11511152 extract (Tuple' (Just buf) r1) = do
@@ -1158,7 +1159,8 @@ lpackArraysChunksOf n (Fold step1 initial1 extract1) =
11581159 then do
11591160 r <- step1 r1 arr
11601161 extract1 r
1161− Tuple' Nothing <$> initial1
1162+ r1' <- initial1
1163+ return (Tuple' Nothing r1')
11621164 else return (Tuple' (Just arr) r1)
11631165
11641166 step (Tuple' (Just buf) r1) arr = do
@@ -1172,7 +1174,8 @@ lpackArraysChunksOf n (Fold step1 initial1 extract1) =
11721174 then do
11731175 r <- step1 r1 buf''
11741176 extract1 r
1175− Tuple' Nothing <$> initial1
1177+ r1' <- initial1
1178+ return (Tuple' Nothing r1')
11761179 else return (Tuple' (Just buf'') r1)
11771180
11781181#if !defined(mingw32_HOST_OS)