mirror of
https://github.com/ilyakooo0/streamly.git
synced 2024-10-06 05:07:07 +03:00
change fromListM to fromFoldable, add a rewrite rule for serial streams
This commit is contained in:
parent
4d1e39de33
commit
6e513737d5
@ -506,10 +506,15 @@ fromFoldableM = Prelude.foldr consM K.nil
|
||||
-- @since 0.4.0
|
||||
{-# INLINE_EARLY fromListM #-}
|
||||
fromListM :: (MonadAsync m, IsStream t) => [m a] -> t m a
|
||||
fromListM = fromStreamD . D.fromListM
|
||||
fromListM = fromFoldableM
|
||||
{-# RULES "fromListM fallback to StreamK" [1]
|
||||
forall a. D.toStreamK (D.fromListM a) = fromFoldableM a #-}
|
||||
|
||||
{-# RULES "fromListM serial" fromListM = fromListMSerial #-}
|
||||
{-# INLINE_EARLY fromListMSerial #-}
|
||||
fromListMSerial :: MonadAsync m => [m a] -> SerialT m a
|
||||
fromListMSerial = fromStreamD . D.fromListM
|
||||
|
||||
-- | Same as 'fromFoldable'.
|
||||
--
|
||||
-- @since 0.1.0
|
||||
|
Loading…
Reference in New Issue
Block a user