diff --git a/library/Potoki/Transform.hs b/library/Potoki/Transform.hs
--- a/library/Potoki/Transform.hs
+++ b/library/Potoki/Transform.hs
@@ -28,6 +28,8 @@
   -- * File IO
   deleteFile,
   appendBytesToFile,
+  -- * Debugging
+  traceWithCounter,
 )
 where
 
@@ -242,3 +244,15 @@
                       return nil
                 in join (fetchListIO nilIO justIO)
             in fetchElementIO
+
+{-|
+Useful for debugging
+-}
+traceWithCounter :: (Int -> String) -> Transform a a
+traceWithCounter show =
+  ioTransform $ do
+    counter <- newIORef 0
+    return $ mapInIO $ \ x -> do
+      n <- atomicModifyIORef' counter (\ n -> (succ n, n))
+      putStrLn (show n)
+      return x
diff --git a/potoki.cabal b/potoki.cabal
--- a/potoki.cabal
+++ b/potoki.cabal
@@ -1,7 +1,7 @@
 name:
   potoki
 version:
-  0.10.1
+  0.10.2
 synopsis:
   Simple streaming in IO
 description:
