diff --git a/library/Potoki/Produce.hs b/library/Potoki/Produce.hs
--- a/library/Potoki/Produce.hs
+++ b/library/Potoki/Produce.hs
@@ -93,6 +93,9 @@
     failure exception =
       return (pure (Left exception), return ())
 
+{-|
+Sorted subpaths of the directory.
+-}
 {-# INLINABLE directoryContents #-}
 directoryContents :: FilePath -> Produce (Either IOException FilePath)
 directoryContents path =
@@ -101,7 +104,7 @@
     success =
       do
         subPaths <- G.listDirectory path
-        ref <- newIORef (map (Right . mappend path . (:) '/') subPaths)
+        ref <- newIORef (map (Right . mappend path . (:) '/') (sort subPaths))
         return (A.list ref, return ())
     failure exception =
       return (pure (Left exception), return ())
diff --git a/potoki.cabal b/potoki.cabal
--- a/potoki.cabal
+++ b/potoki.cabal
@@ -1,7 +1,7 @@
 name:
   potoki
 version:
-  0.6.2
+  0.6.3
 synopsis:
   Simple streaming in IO
 description:
