@@ -524,17 +524,20 @@ data Tuple4' a b c d = Tuple4' !a !b !c !d deriving Show
524{-# INLINE slidingWindow #-}
524{-# INLINE slidingWindow #-}
525slidingWindow :: forall m a b. (MonadIO m, Storable a)
525slidingWindow :: forall m a b. (MonadIO m, Storable a)
526 => Int -> Fold m (a, Maybe a) b -> Fold m a b
526 => Int -> Fold m (a, Maybe a) b -> Fold m a b
527−slidingWindow n (Fold step1 initial1 extract1)= Fold step initial extract
527+slidingWindow n (Fold step1 initial1 extract1) = Fold step initial extract
531 initial = do
531 initial = do
533+ then error "Window size must be > 0"
532− r <- initial1
535+ r <- initial1
533− (rb, rh) <- liftIO $ new n
536+ (rb, rh) <- liftIO $ new n
534− return $
537+ return $
535− case r of
538+ case r of
536− Partial s -> Partial $ Tuple4' rb rh (0 :: Int) s
539+ Partial s -> Partial $ Tuple4' rb rh (0 :: Int) s
537− Done b -> Done b
540+ Done b -> Done b
539 step (Tuple4' rb rh i st) a
542 step (Tuple4' rb rh i st) a
540 | i < n = do
543 | i < n = do