Add a todo about change in the Fold type

This commit is contained in:
Harendra Kumar 2024-07-28 10:15:06 +05:30
parent 818a25fe9d
commit fd2e8bcf6e

View File

@ -541,6 +541,27 @@ data Fold m a b =
-- | @Fold@ @step@ @initial@ @extract@ @final@
forall s. Fold (s -> a -> m (Step s b)) (m (Step s b)) (s -> m b) (s -> m b)
{-
-- XXX Change the type to as follows. This takes care of the unfoldMany case
-- where we need to continue in produce mode. Can we keep the same Step as
-- Scanl without impacting the key-value folds?
--
-- Note: this will require a change in Parser type as well for Parser.fromFold
-- to work.
--
data Step s b =
Consume s
| Produce s
| Stop b
data Fold m a b =
forall s. Fold
(s -> a -> m (Step s b)) -- consume step
(m (Step s b)) -- initial
(s -> m (Step s b)) -- produce step
(s -> m (Step s b)) -- drain step
-}
------------------------------------------------------------------------------
-- Mapping on the output
------------------------------------------------------------------------------