on master help sign in
Use INLINE instead of INLINABLE in open loop ops
fe478a4Harendra Kumar
src/Streamly/Internal/Data/Fold.hs+23−23
@@ -478,7 +478,7 @@ postscan (Fold stepL initialL extractL) (Fold stepR initialR extractR) =
478-- See also: 'Streamly.Prelude.mapM_'
478-- See also: 'Streamly.Prelude.mapM_'
479--
479--
480-- @since 0.7.0
480-- @since 0.7.0
481−{-# INLINABLE drainBy #-}
481+{-# INLINE drainBy #-}
482drainBy :: Monad m => (a -> m b) -> Fold m a ()
482drainBy :: Monad m => (a -> m b) -> Fold m a ()
483drainBy f = lmapM f drain
483drainBy f = lmapM f drain
484
484
@@ -487,7 +487,7 @@ drainBy f = lmapM f drain
487-- > last = fmap getLast $ Fold.foldMap (Last . Just)
487-- > last = fmap getLast $ Fold.foldMap (Last . Just)
488--
488--
489-- @since 0.7.0
489-- @since 0.7.0
490−{-# INLINABLE last #-}
490+{-# INLINE last #-}
491last :: Monad m => Fold m a (Maybe a)
491last :: Monad m => Fold m a (Maybe a)
492last = foldl1' (\_ x -> x)
492last = foldl1' (\_ x -> x)
493
493
@@ -612,7 +612,7 @@ minimum = foldl1' min
612-- stream.
612-- stream.
613--
613--
614-- @since 0.7.0
614-- @since 0.7.0
615−{-# INLINABLE mean #-}
615+{-# INLINE mean #-}
616mean :: (Monad m, Fractional a) => Fold m a a
616mean :: (Monad m, Fractional a) => Fold m a a
617mean = fmap done $ foldl' step begin
617mean = fmap done $ foldl' step begin
618
618
@@ -630,7 +630,7 @@ mean = fmap done $ foldl' step begin
630-- the input stream.
630-- the input stream.
631--
631--
632-- @since 0.7.0
632-- @since 0.7.0
633−{-# INLINABLE variance #-}
633+{-# INLINE variance #-}
634variance :: (Monad m, Fractional a) => Fold m a a
634variance :: (Monad m, Fractional a) => Fold m a a
635variance = fmap done $ foldl' step begin
635variance = fmap done $ foldl' step begin
636
636
@@ -653,7 +653,7 @@ variance = fmap done $ foldl' step begin
653-- elements in the input stream.
653-- elements in the input stream.
654--
654--
655-- @since 0.7.0
655-- @since 0.7.0
656−{-# INLINABLE stdDev #-}
656+{-# INLINE stdDev #-}
657stdDev :: (Monad m, Floating a) => Fold m a a
657stdDev :: (Monad m, Floating a) => Fold m a a
658stdDev = sqrt <$> variance
658stdDev = sqrt <$> variance
659
659
@@ -669,7 +669,7 @@ stdDev = sqrt <$> variance
669-- See https://en.wikipedia.org/wiki/Rolling_hash
669-- See https://en.wikipedia.org/wiki/Rolling_hash
670--
670--
671-- @since 0.8.0
671-- @since 0.8.0
672−{-# INLINABLE rollingHashWithSalt #-}
672+{-# INLINE rollingHashWithSalt #-}
673rollingHashWithSalt :: (Monad m, Enum a) => Int64 -> Fold m a Int64
673rollingHashWithSalt :: (Monad m, Enum a) => Int64 -> Fold m a Int64
674rollingHashWithSalt = foldl' step
674rollingHashWithSalt = foldl' step
675
675
@@ -689,7 +689,7 @@ defaultSalt = -2578643520546668380
689-- > rollingHash = Fold.rollingHashWithSalt defaultSalt
689-- > rollingHash = Fold.rollingHashWithSalt defaultSalt
690--
690--
691-- @since 0.8.0
691-- @since 0.8.0
692−{-# INLINABLE rollingHash #-}
692+{-# INLINE rollingHash #-}
693rollingHash :: (Monad m, Enum a) => Fold m a Int64
693rollingHash :: (Monad m, Enum a) => Fold m a Int64
694rollingHash = rollingHashWithSalt defaultSalt
694rollingHash = rollingHashWithSalt defaultSalt
695
695
@@ -699,7 +699,7 @@ rollingHash = rollingHashWithSalt defaultSalt
699-- > rollingHashFirstN = Fold.take n Fold.rollingHash
699-- > rollingHashFirstN = Fold.take n Fold.rollingHash
700--
700--
701-- /Pre-release/
701-- /Pre-release/
702−{-# INLINABLE rollingHashFirstN #-}
702+{-# INLINE rollingHashFirstN #-}
703rollingHashFirstN :: (Monad m, Enum a) => Int -> Fold m a Int64
703rollingHashFirstN :: (Monad m, Enum a) => Int -> Fold m a Int64
704rollingHashFirstN n = take n rollingHash
704rollingHashFirstN n = take n rollingHash
705
705
@@ -749,7 +749,7 @@ mconcat = sconcat mempty
749-- Sum {getSum = 55}
749-- Sum {getSum = 55}
750--
750--
751-- @since 0.7.0
751-- @since 0.7.0
752−{-# INLINABLE foldMap #-}
752+{-# INLINE foldMap #-}
753foldMap :: (Monad m, Monoid b
753foldMap :: (Monad m, Monoid b
754#if !MIN_VERSION_base(4,11,0)
754#if !MIN_VERSION_base(4,11,0)
755 , Semigroup b
755 , Semigroup b
@@ -767,7 +767,7 @@ foldMap f = lmap f mconcat
767-- Sum {getSum = 55}
767-- Sum {getSum = 55}
768--
768--
769-- @since 0.7.0
769-- @since 0.7.0
770−{-# INLINABLE foldMapM #-}
770+{-# INLINE foldMapM #-}
771foldMapM :: (Monad m, Monoid b) => (a -> m b) -> Fold m a b
771foldMapM :: (Monad m, Monoid b) => (a -> m b) -> Fold m a b
772foldMapM act = foldlM' step (pure mempty)
772foldMapM act = foldlM' step (pure mempty)
773
773
@@ -795,7 +795,7 @@ foldMapM act = foldlM' step (pure mempty)
795-- @since 0.8.0
795-- @since 0.8.0
796
796
797-- xn : ... : x2 : x1 : []
797-- xn : ... : x2 : x1 : []
798−{-# INLINABLE toListRev #-}
798+{-# INLINE toListRev #-}
799toListRev :: Monad m => Fold m a [a]
799toListRev :: Monad m => Fold m a [a]
800toListRev = foldl' (flip (:)) []
800toListRev = foldl' (flip (:)) []
801
801
@@ -820,7 +820,7 @@ drainN n = take n drain
820-- | Like 'index', except with a more general 'Integral' argument
820-- | Like 'index', except with a more general 'Integral' argument
821--
821--
822-- /Pre-release/
822-- /Pre-release/
823−{-# INLINABLE genericIndex #-}
823+{-# INLINE genericIndex #-}
824genericIndex :: (Integral i, Monad m) => i -> Fold m a (Maybe a)
824genericIndex :: (Integral i, Monad m) => i -> Fold m a (Maybe a)
825genericIndex i = mkFold step (Partial 0) (const Nothing)
825genericIndex i = mkFold step (Partial 0) (const Nothing)
826
826
@@ -836,21 +836,21 @@ genericIndex i = mkFold step (Partial 0) (const Nothing)
836-- See also: 'Streamly.Prelude.!!'
836-- See also: 'Streamly.Prelude.!!'
837--
837--
838-- @since 0.7.0
838-- @since 0.7.0
839−{-# INLINABLE index #-}
839+{-# INLINE index #-}
840index :: Monad m => Int -> Fold m a (Maybe a)
840index :: Monad m => Int -> Fold m a (Maybe a)
841index = genericIndex
841index = genericIndex
842
842
843-- | Extract the first element of the stream, if any.
843-- | Extract the first element of the stream, if any.
844--
844--
845-- @since 0.7.0
845-- @since 0.7.0
846−{-# INLINABLE head #-}
846+{-# INLINE head #-}
847head :: Monad m => Fold m a (Maybe a)
847head :: Monad m => Fold m a (Maybe a)
848head = mkFold_ (const (Done . Just)) (Partial Nothing)
848head = mkFold_ (const (Done . Just)) (Partial Nothing)
849
849
850-- | Returns the first element that satisfies the given predicate.
850-- | Returns the first element that satisfies the given predicate.
851--
851--
852-- @since 0.7.0
852-- @since 0.7.0
853−{-# INLINABLE find #-}
853+{-# INLINE find #-}
854find :: Monad m => (a -> Bool) -> Fold m a (Maybe a)
854find :: Monad m => (a -> Bool) -> Fold m a (Maybe a)
855find predicate = mkFold step (Partial ()) (const Nothing)
855find predicate = mkFold step (Partial ()) (const Nothing)
856
856
@@ -867,7 +867,7 @@ find predicate = mkFold step (Partial ()) (const Nothing)
867-- > lookup = snd <$> Fold.find ((==) . fst)
867-- > lookup = snd <$> Fold.find ((==) . fst)
868--
868--
869-- @since 0.7.0
869-- @since 0.7.0
870−{-# INLINABLE lookup #-}
870+{-# INLINE lookup #-}
871lookup :: (Eq a, Monad m) => a -> Fold m (a,b) (Maybe b)
871lookup :: (Eq a, Monad m) => a -> Fold m (a,b) (Maybe b)
872lookup a0 = mkFold step (Partial ()) (const Nothing)
872lookup a0 = mkFold step (Partial ()) (const Nothing)
873
873
@@ -881,7 +881,7 @@ lookup a0 = mkFold step (Partial ()) (const Nothing)
881-- | Returns the first index that satisfies the given predicate.
881-- | Returns the first index that satisfies the given predicate.
882--
882--
883-- @since 0.7.0
883-- @since 0.7.0
884−{-# INLINABLE findIndex #-}
884+{-# INLINE findIndex #-}
885findIndex :: Monad m => (a -> Bool) -> Fold m a (Maybe Int)
885findIndex :: Monad m => (a -> Bool) -> Fold m a (Maybe Int)
886findIndex predicate = mkFold step (Partial 0) (const Nothing)
886findIndex predicate = mkFold step (Partial 0) (const Nothing)
887
887
@@ -897,7 +897,7 @@ findIndex predicate = mkFold step (Partial 0) (const Nothing)
897-- > elemIndex a = Fold.findIndex (== a)
897-- > elemIndex a = Fold.findIndex (== a)
898--
898--
899-- @since 0.7.0
899-- @since 0.7.0
900−{-# INLINABLE elemIndex #-}
900+{-# INLINE elemIndex #-}
901elemIndex :: (Eq a, Monad m) => a -> Fold m a (Maybe Int)
901elemIndex :: (Eq a, Monad m) => a -> Fold m a (Maybe Int)
902elemIndex a = findIndex (a ==)
902elemIndex a = findIndex (a ==)
903
903
@@ -910,7 +910,7 @@ elemIndex a = findIndex (a ==)
910-- > null = fmap isJust Fold.head
910-- > null = fmap isJust Fold.head
911--
911--
912-- @since 0.7.0
912-- @since 0.7.0
913−{-# INLINABLE null #-}
913+{-# INLINE null #-}
914null :: Monad m => Fold m a Bool
914null :: Monad m => Fold m a Bool
915null = mkFold (\() _ -> Done False) (Partial ()) (const True)
915null = mkFold (\() _ -> Done False) (Partial ()) (const True)
916
916
@@ -940,7 +940,7 @@ any predicate = mkFold_ step initial
940-- > elem a = Fold.any (== a)
940-- > elem a = Fold.any (== a)
941--
941--
942-- @since 0.7.0
942-- @since 0.7.0
943−{-# INLINABLE elem #-}
943+{-# INLINE elem #-}
944elem :: (Eq a, Monad m) => a -> Fold m a Bool
944elem :: (Eq a, Monad m) => a -> Fold m a Bool
945elem a = any (a ==)
945elem a = any (a ==)
946
946
@@ -952,7 +952,7 @@ elem a = any (a ==)
952-- > all p = Fold.lmap p Fold.and
952-- > all p = Fold.lmap p Fold.and
953--
953--
954-- @since 0.7.0
954-- @since 0.7.0
955−{-# INLINABLE all #-}
955+{-# INLINE all #-}
956all :: Monad m => (a -> Bool) -> Fold m a Bool
956all :: Monad m => (a -> Bool) -> Fold m a Bool
957all predicate = mkFold_ step initial
957all predicate = mkFold_ step initial
958
958
@@ -970,7 +970,7 @@ all predicate = mkFold_ step initial
970-- > notElem a = Fold.all (/= a)
970-- > notElem a = Fold.all (/= a)
971--
971--
972-- @since 0.7.0
972-- @since 0.7.0
973−{-# INLINABLE notElem #-}
973+{-# INLINE notElem #-}
974notElem :: (Eq a, Monad m) => a -> Fold m a Bool
974notElem :: (Eq a, Monad m) => a -> Fold m a Bool
975notElem a = all (a /=)
975notElem a = all (a /=)
976
976
@@ -1782,6 +1782,6 @@ toStream = fmap SerialT toStreamK
1782-- /Pre-release/
1782-- /Pre-release/
1783
1783
1784-- xn : ... : x2 : x1 : []
1784-- xn : ... : x2 : x1 : []
1785−{-# INLINABLE toStreamRev #-}
1785+{-# INLINE toStreamRev #-}
1786toStreamRev :: Monad m => Fold m a (SerialT n a)
1786toStreamRev :: Monad m => Fold m a (SerialT n a)
1787toStreamRev = fmap SerialT toStreamKRev
1787toStreamRev = fmap SerialT toStreamKRev
src/Streamly/Internal/Data/Fold/Type.hs+7−7
@@ -541,7 +541,7 @@ drain = foldl' (\_ _ -> ()) ()
541-- > toList = foldr (:) []
541-- > toList = foldr (:) []
542--
542--
543-- @since 0.7.0
543-- @since 0.7.0
544−{-# INLINABLE toList #-}
544+{-# INLINE toList #-}
545toList :: Monad m => Fold m a [a]
545toList :: Monad m => Fold m a [a]
546toList = foldr (:) []
546toList = foldr (:) []
547
547
@@ -556,7 +556,7 @@ toList = foldr (:) []
556-- /Pre-release/
556-- /Pre-release/
557
557
558-- xn : ... : x2 : x1 : []
558-- xn : ... : x2 : x1 : []
559−{-# INLINABLE toStreamKRev #-}
559+{-# INLINE toStreamKRev #-}
560toStreamKRev :: Monad m => Fold m a (K.Stream n a)
560toStreamKRev :: Monad m => Fold m a (K.Stream n a)
561toStreamKRev = foldl' (flip K.cons) K.nil
561toStreamKRev = foldl' (flip K.cons) K.nil
562
562
@@ -987,7 +987,7 @@ concatMap f (Fold stepa initiala extracta) = Fold stepc initialc extractc
987-- > lmap = Fold.lmapM return
987-- > lmap = Fold.lmapM return
988--
988--
989-- @since 0.8.0
989-- @since 0.8.0
990−{-# INLINABLE lmap #-}
990+{-# INLINE lmap #-}
991lmap :: (a -> b) -> Fold m b r -> Fold m a r
991lmap :: (a -> b) -> Fold m b r -> Fold m a r
992lmap f (Fold step begin done) = Fold step' begin done
992lmap f (Fold step begin done) = Fold step' begin done
993 where
993 where
@@ -996,7 +996,7 @@ lmap f (Fold step begin done) = Fold step' begin done
996-- | @lmapM f fold@ maps the monadic function @f@ on the input of the fold.
996-- | @lmapM f fold@ maps the monadic function @f@ on the input of the fold.
997--
997--
998-- @since 0.8.0
998-- @since 0.8.0
999−{-# INLINABLE lmapM #-}
999+{-# INLINE lmapM #-}
1000lmapM :: Monad m => (a -> m b) -> Fold m b r -> Fold m a r
1000lmapM :: Monad m => (a -> m b) -> Fold m b r -> Fold m a r
1001lmapM f (Fold step begin done) = Fold step' begin done
1001lmapM f (Fold step begin done) = Fold step' begin done
1002 where
1002 where
@@ -1014,7 +1014,7 @@ lmapM f (Fold step begin done) = Fold step' begin done
1014-- > filter f = Fold.filterM (return . f)
1014-- > filter f = Fold.filterM (return . f)
1015--
1015--
1016-- @since 0.8.0
1016-- @since 0.8.0
1017−{-# INLINABLE filter #-}
1017+{-# INLINE filter #-}
1018filter :: Monad m => (a -> Bool) -> Fold m a r -> Fold m a r
1018filter :: Monad m => (a -> Bool) -> Fold m a r -> Fold m a r
1019filter f (Fold step begin done) = Fold step' begin done
1019filter f (Fold step begin done) = Fold step' begin done
1020 where
1020 where
@@ -1023,7 +1023,7 @@ filter f (Fold step begin done) = Fold step' begin done
1023-- | Like 'filter' but with a monadic predicate.
1023-- | Like 'filter' but with a monadic predicate.
1024--
1024--
1025-- @since 0.8.0
1025-- @since 0.8.0
1026−{-# INLINABLE filterM #-}
1026+{-# INLINE filterM #-}
1027filterM :: Monad m => (a -> m Bool) -> Fold m a r -> Fold m a r
1027filterM :: Monad m => (a -> m Bool) -> Fold m a r -> Fold m a r
1028filterM f (Fold step begin done) = Fold step' begin done
1028filterM f (Fold step begin done) = Fold step' begin done
1029 where
1029 where
@@ -1105,7 +1105,7 @@ take n (Fold fstep finitial fextract) = Fold step initial extract
1105-- fold. Compare with 'snoc' which appends a singleton value to the fold.
1105-- fold. Compare with 'snoc' which appends a singleton value to the fold.
1106--
1106--
1107-- /Pre-release/
1107-- /Pre-release/
1108−{-# INLINABLE duplicate #-}
1108+{-# INLINE duplicate #-}
1109duplicate :: Monad m => Fold m a b -> Fold m a (Fold m a b)
1109duplicate :: Monad m => Fold m a b -> Fold m a (Fold m a b)
1110duplicate (Fold step1 initial1 extract1) =
1110duplicate (Fold step1 initial1 extract1) =
1111 Fold step initial (\s -> pure $ Fold step1 (pure $ Partial s) extract1)
1111 Fold step initial (\s -> pure $ Fold step1 (pure $ Partial s) extract1)
src/Streamly/Internal/Data/Maybe/Strict.hs+3−3
@@ -29,20 +29,20 @@ where
29data Maybe' a = Just' !a | Nothing' deriving Show
29data Maybe' a = Just' !a | Nothing' deriving Show
30
30
31-- | Convert strict Maybe' to lazy Maybe
31-- | Convert strict Maybe' to lazy Maybe
32−{-# INLINABLE toMaybe #-}
32+{-# INLINE toMaybe #-}
33toMaybe :: Maybe' a -> Maybe a
33toMaybe :: Maybe' a -> Maybe a
34toMaybe Nothing' = Nothing
34toMaybe Nothing' = Nothing
35toMaybe (Just' a) = Just a
35toMaybe (Just' a) = Just a
36
36
37-- | Extract the element out of a Just' and throws an error if its argument is
37-- | Extract the element out of a Just' and throws an error if its argument is
38-- Nothing'.
38-- Nothing'.
39−{-# INLINABLE fromJust' #-}
39+{-# INLINE fromJust' #-}
40fromJust' :: Maybe' a -> a
40fromJust' :: Maybe' a -> a
41fromJust' (Just' a) = a
41fromJust' (Just' a) = a
42fromJust' Nothing' = error "fromJust' cannot be run in Nothing'"
42fromJust' Nothing' = error "fromJust' cannot be run in Nothing'"
43
43
44-- | Returns True iff its argument is of the form "Just' _".
44-- | Returns True iff its argument is of the form "Just' _".
45−{-# INLINABLE isJust' #-}
45+{-# INLINE isJust' #-}
46isJust' :: Maybe' a -> Bool
46isJust' :: Maybe' a -> Bool
47isJust' (Just' _) = True
47isJust' (Just' _) = True
48isJust' Nothing' = False
48isJust' Nothing' = False
src/Streamly/Internal/Data/Stream/IsStream/Common.hs+2−2
@@ -680,7 +680,7 @@ splitOnSeq patt f m =
680-- | Like 'zipWith' but using a monadic zipping function.
680-- | Like 'zipWith' but using a monadic zipping function.
681--
681--
682-- @since 0.4.0
682-- @since 0.4.0
683−{-# INLINABLE zipWithM #-}
683+{-# INLINE zipWithM #-}
684zipWithM :: (IsStream t, Monad m) => (a -> b -> m c) -> t m a -> t m b -> t m c
684zipWithM :: (IsStream t, Monad m) => (a -> b -> m c) -> t m a -> t m b -> t m c
685zipWithM f m1 m2 =
685zipWithM f m1 m2 =
686 IsStream.fromStreamS
686 IsStream.fromStreamS
@@ -699,7 +699,7 @@ zipWithM f m1 m2 =
699-- @
699-- @
700--
700--
701-- @since 0.1.0
701-- @since 0.1.0
702−{-# INLINABLE zipWith #-}
702+{-# INLINE zipWith #-}
703zipWith :: (IsStream t, Monad m) => (a -> b -> c) -> t m a -> t m b -> t m c
703zipWith :: (IsStream t, Monad m) => (a -> b -> c) -> t m a -> t m b -> t m c
704zipWith f m1 m2 =
704zipWith f m1 m2 =
705 IsStream.fromStreamS
705 IsStream.fromStreamS
src/Streamly/Internal/Data/Stream/IsStream/Expand.hs+1−1
@@ -745,7 +745,7 @@ mergeBy f m1 m2 = fromStream $ K.mergeBy f (toStream m1) (toStream m2)
745-- See also: 'mergeByMFused'
745-- See also: 'mergeByMFused'
746--
746--
747-- @since 0.6.0
747-- @since 0.6.0
748−{-# INLINABLE mergeByM #-}
748+{-# INLINE mergeByM #-}
749mergeByM
749mergeByM
750 :: (IsStream t, Monad m)
750 :: (IsStream t, Monad m)
751 => (a -> a -> m Ordering) -> t m a -> t m a -> t m a
751 => (a -> a -> m Ordering) -> t m a -> t m a -> t m a
src/Streamly/Internal/Data/Stream/IsStream/Reduce.hs+2−2
@@ -1492,7 +1492,7 @@ classifySessionsBy tick reset ejectPred tmout
1492--
1492--
1493-- /Pre-release/
1493-- /Pre-release/
1494--
1494--
1495−{-# INLINABLE classifyKeepAliveSessions #-}
1495+{-# INLINE classifyKeepAliveSessions #-}
1496classifyKeepAliveSessions ::
1496classifyKeepAliveSessions ::
1497 (IsStream t, MonadAsync m, Ord k)
1497 (IsStream t, MonadAsync m, Ord k)
1498 => (Int -> m Bool) -- ^ predicate to eject sessions on session count
1498 => (Int -> m Bool) -- ^ predicate to eject sessions on session count
@@ -1539,7 +1539,7 @@ classifyChunksOf wsize = classifyChunksBy wsize False
1539--
1539--
1540-- /Pre-release/
1540-- /Pre-release/
1541--
1541--
1542−{-# INLINABLE classifySessionsOf #-}
1542+{-# INLINE classifySessionsOf #-}
1543classifySessionsOf ::
1543classifySessionsOf ::
1544 (IsStream t, MonadAsync m, Ord k)
1544 (IsStream t, MonadAsync m, Ord k)
1545 => (Int -> m Bool) -- ^ predicate to eject sessions on session count
1545 => (Int -> m Bool) -- ^ predicate to eject sessions on session count
src/Streamly/Internal/Data/Stream/IsStream/Type.hs+1−1
@@ -654,7 +654,7 @@ concatMapWith par f xs = bindWith par xs f
654-- /Since: 0.8.0 (Renamed foldMapWith to concatMapFoldableWith)/
654-- /Since: 0.8.0 (Renamed foldMapWith to concatMapFoldableWith)/
655--
655--
656-- /Since: 0.1.0 ("Streamly")/
656-- /Since: 0.1.0 ("Streamly")/
657−{-# INLINABLE concatMapFoldableWith #-}
657+{-# INLINE concatMapFoldableWith #-}
658concatMapFoldableWith :: (IsStream t, Foldable f)
658concatMapFoldableWith :: (IsStream t, Foldable f)
659 => (t m b -> t m b -> t m b) -> (a -> t m b) -> f a -> t m b
659 => (t m b -> t m b -> t m b) -> (a -> t m b) -> f a -> t m b
660concatMapFoldableWith f g = Prelude.foldr (f . g) nil
660concatMapFoldableWith f g = Prelude.foldr (f . g) nil
src/Streamly/Internal/FileSystem/Dir.hs+1−1
@@ -103,7 +103,7 @@ readArrayUpto size h = do
103-- | @toChunksWithBufferOf size h@ reads a stream of arrays from file handle @h@.
103-- | @toChunksWithBufferOf size h@ reads a stream of arrays from file handle @h@.
104-- The maximum size of a single array is specified by @size@. The actual size
104-- The maximum size of a single array is specified by @size@. The actual size
105-- read may be less than or equal to @size@.
105-- read may be less than or equal to @size@.
106−{-# INLINABLE _toChunksWithBufferOf #-}
106+{-# INLINE _toChunksWithBufferOf #-}
107_toChunksWithBufferOf :: (IsStream t, MonadIO m)
107_toChunksWithBufferOf :: (IsStream t, MonadIO m)
108 => Int -> Handle -> t m (Array Word8)
108 => Int -> Handle -> t m (Array Word8)
109_toChunksWithBufferOf size h = go
109_toChunksWithBufferOf size h = go
src/Streamly/Internal/FileSystem/FD.hs+1−1
@@ -277,7 +277,7 @@ writeIOVec (Handle fd) iov =
277-- | @readArraysOfUpto size h@ reads a stream of arrays from file handle @h@.
277-- | @readArraysOfUpto size h@ reads a stream of arrays from file handle @h@.
278-- The maximum size of a single array is specified by @size@. The actual size
278-- The maximum size of a single array is specified by @size@. The actual size
279-- read may be less than or equal to @size@.
279-- read may be less than or equal to @size@.
280−{-# INLINABLE _readArraysOfUpto #-}
280+{-# INLINE _readArraysOfUpto #-}
281_readArraysOfUpto :: (IsStream t, MonadIO m)
281_readArraysOfUpto :: (IsStream t, MonadIO m)
282 => Int -> Handle -> t m (Array Word8)
282 => Int -> Handle -> t m (Array Word8)
283_readArraysOfUpto size h = go
283_readArraysOfUpto size h = go
src/Streamly/Internal/FileSystem/File.hs+4−4
@@ -151,14 +151,14 @@ withFile file mode = S.bracket (liftIO $ openFile file mode) (liftIO . hClose)
151--
151--
152-- /Pre-release/
152-- /Pre-release/
153--
153--
154−{-# INLINABLE usingFile #-}
154+{-# INLINE usingFile #-}
155usingFile :: (MonadCatch m, MonadAsync m)
155usingFile :: (MonadCatch m, MonadAsync m)
156 => Unfold m Handle a -> Unfold m FilePath a
156 => Unfold m Handle a -> Unfold m FilePath a
157usingFile =
157usingFile =
158 UF.bracket (\file -> liftIO $ openFile file ReadMode)
158 UF.bracket (\file -> liftIO $ openFile file ReadMode)
159 (liftIO . hClose)
159 (liftIO . hClose)
160
160
161−{-# INLINABLE usingFile2 #-}
161+{-# INLINE usingFile2 #-}
162usingFile2 :: (MonadCatch m, MonadAsync m)
162usingFile2 :: (MonadCatch m, MonadAsync m)
163 => Unfold m (x, Handle) a -> Unfold m (x, FilePath) a
163 => Unfold m (x, Handle) a -> Unfold m (x, FilePath) a
164usingFile2 = UF.bracket before after
164usingFile2 = UF.bracket before after
@@ -171,7 +171,7 @@ usingFile2 = UF.bracket before after
171
171
172 after (_, h) = liftIO $ hClose h
172 after (_, h) = liftIO $ hClose h
173
173
174−{-# INLINABLE usingFile3 #-}
174+{-# INLINE usingFile3 #-}
175usingFile3 :: (MonadCatch m, MonadAsync m)
175usingFile3 :: (MonadCatch m, MonadAsync m)
176 => Unfold m (x, y, z, Handle) a -> Unfold m (x, y, z, FilePath) a
176 => Unfold m (x, y, z, Handle) a -> Unfold m (x, y, z, FilePath) a
177usingFile3 = UF.bracket before after
177usingFile3 = UF.bracket before after
@@ -215,7 +215,7 @@ appendArray file arr = SIO.withFile file AppendMode (`FH.putChunk` arr)
215-- | @toChunksWithBufferOf size file@ reads a stream of arrays from file @file@.
215-- | @toChunksWithBufferOf size file@ reads a stream of arrays from file @file@.
216-- The maximum size of a single array is specified by @size@. The actual size
216-- The maximum size of a single array is specified by @size@. The actual size
217-- read may be less than or equal to @size@.
217-- read may be less than or equal to @size@.
218−{-# INLINABLE toChunksWithBufferOf #-}
218+{-# INLINE toChunksWithBufferOf #-}
219toChunksWithBufferOf :: (IsStream t, MonadCatch m, MonadAsync m)
219toChunksWithBufferOf :: (IsStream t, MonadCatch m, MonadAsync m)
220 => Int -> FilePath -> t m (Array Word8)
220 => Int -> FilePath -> t m (Array Word8)
221toChunksWithBufferOf size file =
221toChunksWithBufferOf size file =
src/Streamly/Internal/FileSystem/Handle.hs+1−1
@@ -206,7 +206,7 @@ getChunkOf = undefined
206-- | @toChunksWithBufferOf size h@ reads a stream of arrays from file handle @h@.
206-- | @toChunksWithBufferOf size h@ reads a stream of arrays from file handle @h@.
207-- The maximum size of a single array is specified by @size@. The actual size
207-- The maximum size of a single array is specified by @size@. The actual size
208-- read may be less than or equal to @size@.
208-- read may be less than or equal to @size@.
209−{-# INLINABLE _toChunksWithBufferOf #-}
209+{-# INLINE _toChunksWithBufferOf #-}
210_toChunksWithBufferOf :: (IsStream t, MonadIO m)
210_toChunksWithBufferOf :: (IsStream t, MonadIO m)
211 => Int -> Handle -> t m (Array Word8)
211 => Int -> Handle -> t m (Array Word8)
212_toChunksWithBufferOf size h = go
212_toChunksWithBufferOf size h = go
src/Streamly/Internal/Network/Inet/TCP.hs+4−4
@@ -277,7 +277,7 @@ withConnectionM addr port =
277-- exception, then this exception will be raised by 'usingConnection'.
277-- exception, then this exception will be raised by 'usingConnection'.
278--
278--
279-- /Pre-release/
279-- /Pre-release/
280−{-# INLINABLE usingConnection #-}
280+{-# INLINE usingConnection #-}
281usingConnection :: (MonadCatch m, MonadAsync m)
281usingConnection :: (MonadCatch m, MonadAsync m)
282 => Unfold m Socket a
282 => Unfold m Socket a
283 -> Unfold m ((Word8, Word8, Word8, Word8), PortNumber) a
283 -> Unfold m ((Word8, Word8, Word8, Word8), PortNumber) a
@@ -297,7 +297,7 @@ usingConnection =
297-- 'withConnection' rather than any exception raised by 'act'.
297-- 'withConnection' rather than any exception raised by 'act'.
298--
298--
299-- /Pre-release/
299-- /Pre-release/
300−{-# INLINABLE withConnection #-}
300+{-# INLINE withConnection #-}
301withConnection :: (IsStream t, MonadCatch m, MonadAsync m)
301withConnection :: (IsStream t, MonadCatch m, MonadAsync m)
302 => (Word8, Word8, Word8, Word8) -> PortNumber -> (Socket -> t m a) -> t m a
302 => (Word8, Word8, Word8, Word8) -> PortNumber -> (Socket -> t m a) -> t m a
303withConnection addr port =
303withConnection addr port =
@@ -418,7 +418,7 @@ write = writeWithBufferOf defaultChunkSize
418-- Transformations
418-- Transformations
419-------------------------------------------------------------------------------
419-------------------------------------------------------------------------------
420
420
421−{-# INLINABLE withInputConnect #-}
421+{-# INLINE withInputConnect #-}
422withInputConnect
422withInputConnect
423 :: (IsStream t, MonadCatch m, MonadAsync m)
423 :: (IsStream t, MonadCatch m, MonadAsync m)
424 => (Word8, Word8, Word8, Word8)
424 => (Word8, Word8, Word8, Word8)
@@ -446,7 +446,7 @@ withInputConnect addr port input f = S.bracket pre post handler
446--
446--
447-- /Pre-release/
447-- /Pre-release/
448--
448--
449−{-# INLINABLE processBytes #-}
449+{-# INLINE processBytes #-}
450processBytes
450processBytes
451 :: (IsStream t, MonadAsync m, MonadCatch m)
451 :: (IsStream t, MonadAsync m, MonadCatch m)
452 => (Word8, Word8, Word8, Word8)
452 => (Word8, Word8, Word8, Word8)
src/Streamly/Internal/Network/Socket.hs+1−1
@@ -324,7 +324,7 @@ writeChunk = writeArrayWith sendAll
324-- Stream of Arrays IO
324-- Stream of Arrays IO
325-------------------------------------------------------------------------------
325-------------------------------------------------------------------------------
326
326
327−{-# INLINABLE _readChunksUptoWith #-}
327+{-# INLINE _readChunksUptoWith #-}
328_readChunksUptoWith :: (IsStream t, MonadIO m)
328_readChunksUptoWith :: (IsStream t, MonadIO m)
329 => (Int -> h -> IO (Array Word8))
329 => (Int -> h -> IO (Array Word8))
330 -> Int -> h -> t m (Array Word8)
330 -> Int -> h -> t m (Array Word8)