From a35e25db298083e99bc1517f87def80ce6584b99 Mon Sep 17 00:00:00 2001 From: Shlok Datye Date: Wed, 10 May 2023 12:11:19 +0200 Subject: [PATCH] Add warning to demux documentation --- core/src/Streamly/Internal/Data/Fold/Container.hs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/src/Streamly/Internal/Data/Fold/Container.hs b/core/src/Streamly/Internal/Data/Fold/Container.hs index 32b3af4b02..f168cb328f 100644 --- a/core/src/Streamly/Internal/Data/Fold/Container.hs +++ b/core/src/Streamly/Internal/Data/Fold/Container.hs @@ -326,6 +326,10 @@ demuxGeneric getKey getFold = fmap extract $ foldlM' step initial -- This can be used to scan a stream and collect the results from the scan -- output. -- +-- /Warning/: One should call the returned monadic action to make sure the +-- folds fully complete—even if the action returns nothing useful (e.g., a map +-- of @()@ values). +-- -- /Pre-release/ -- {-# INLINE demux #-}