@@ -62,7 +62,7 @@ source n = UF.enumerateFromToIntegral n
6262
6363{-# INLINE drainGeneration #-}
6464drainGeneration :: Monad m => Unfold m a b -> a -> m ()
65−drainGeneration unf seed = UF.fold unf FL.drain seed
65+drainGeneration unf seed = UF.fold FL.drain unf seed
6666
6767{-# INLINE drainTransformation #-}
6868drainTransformation ::
@@ -409,7 +409,7 @@ toNullAp value start =
409409 let end = start + nthRoot 2 value
410410 s = source end
411411 -- in UF.fold ((+) <$> s <*> s) FL.drain start
412− in UF.fold ((+) `fmap` s `UF.apply` s) FL.drain start
412+ in UF.fold FL.drain ((+) `fmap` s `UF.apply` s) start
413413
414414{-# INLINE _apDiscardFst #-}
415415_apDiscardFst :: Int -> Int -> m ()
@@ -451,7 +451,7 @@ toNull value start =
451451 u = src `UF.bind` \x ->
452452 src `UF.bind` \y ->
453453 UF.yield (x + y)
454− in UF.fold u FL.drain start
454+ in UF.fold FL.drain u start
455455
456456
457457{-# INLINE toNull3 #-}
@@ -469,7 +469,7 @@ toNull3 value start =
469469 u = src `UF.bind` \x ->
470470 src `UF.bind` \y ->
471471 UF.yield (x + y)
472− in UF.fold u FL.drain start
472+ in UF.fold FL.drain u start
473473
474474{-# INLINE toList #-}
475475toList :: Monad m => Int -> Int -> m [Int]
@@ -485,7 +485,7 @@ toList value start = do
485485 u = src `UF.bind` \x ->
486486 src `UF.bind` \y ->
487487 UF.yield (x + y)
488− in UF.fold u FL.toList start
488+ in UF.fold FL.toList u start
489489
490490{-# INLINE toListSome #-}
491491toListSome :: Monad m => Int -> Int -> m [Int]
@@ -501,7 +501,7 @@ toListSome value start = do
501501 u = src `UF.bind` \x ->
502502 src `UF.bind` \y ->
503503 UF.yield (x + y)
504− in UF.fold (UF.take 1000 u) FL.toList start
504+ in UF.fold FL.toList (UF.take 1000 u) start
505505
506506{-# INLINE filterAllOut #-}
507507filterAllOut :: Monad m => Int -> Int -> m ()
@@ -519,7 +519,7 @@ filterAllOut value start = do
519519 in if s < 0
520520 then UF.yield s
521521 else UF.nilM (return . const ())
522− in UF.fold u FL.drain start
522+ in UF.fold FL.drain u start
523523
524524{-# INLINE filterAllIn #-}
525525filterAllIn :: Monad m => Int -> Int -> m ()
@@ -537,7 +537,7 @@ filterAllIn value start = do
537537 in if s > 0
538538 then UF.yield s
539539 else UF.nilM (return . const ())
540− in UF.fold u FL.drain start
540+ in UF.fold FL.drain u start
541541
542542{-# INLINE filterSome #-}
543543filterSome :: Monad m => Int -> Int -> m ()
@@ -555,7 +555,7 @@ filterSome value start = do
555555 in if s > 1100000
556556 then UF.yield s
557557 else UF.nilM (return . const ())
558− in UF.fold u FL.drain start
558+ in UF.fold FL.drain u start
559559
560560{-# INLINE breakAfterSome #-}
561561breakAfterSome :: Int -> Int -> IO ()
@@ -574,7 +574,7 @@ breakAfterSome value start =
574574 then error "break"
575575 else UF.yield s
576576 in do
577− (_ :: Either ErrorCall ()) <- try $ UF.fold u FL.drain start
577+ (_ :: Either ErrorCall ()) <- try $ UF.fold FL.drain u start
578578 return ()
579579
580580-------------------------------------------------------------------------------
@@ -590,9 +590,7 @@ concatCount linearCount =
590590concat :: Monad m => Int -> Int -> m ()
591591concat linearCount start = do
592592 let end = start + concatCount linearCount
593− UF.fold
594− (UF.many (source end) (source end))
595− FL.drain start
593+ UF.fold FL.drain (UF.many (source end) (source end)) start
596594
597595-------------------------------------------------------------------------------
598596-- Benchmarks