@@ -26,7 +26,9 @@ module Streamly.Internal.FileSystem.Dir
2626 -- , readWithBufferOf
2727
2828 , toStream
29− , toStreamEither
29+ , toEither
30+ , toFiles
31+ , toDirs
3032 {-
3133 , toStreamWithBufferOf
3234
@@ -277,10 +279,26 @@ toStream = S.unfold read
277279-- entries.
278280--
279281-- /Internal/
280−{-# INLINE toStreamEither #-}
281−toStreamEither :: (IsStream t, MonadIO m)
282+{-# INLINE toEither #-}
283+toEither :: (IsStream t, MonadIO m)
282284 => String -> t m (Either String String)
283−toStreamEither = S.unfold readEither
285+toEither = S.unfold readEither
286+
287+-- | Read files only.
288+--
289+-- /Internal/
290+--
291+{-# INLINE toFiles #-}
292+toFiles :: (IsStream t, MonadIO m) => String -> t m String
293+toFiles = S.unfold readFiles
294+
295+-- | Read directories only.
296+--
297+-- /Internal/
298+--
299+{-# INLINE toDirs #-}
300+toDirs :: (IsStream t, MonadIO m) => String -> t m String
301+toDirs = S.unfold readDirs
284302
285303{-
286304-------------------------------------------------------------------------------