Open harendra-kumar opened 7 months ago
The minimal change required is to generate the fold using the key k
rather than the value a
for safety:
demux :: (Monad m, Ord k) => (a -> k) -> (k -> m (Fold m a b)) -> Fold m a (m (Map k b), Maybe (k, b))
For key-value inputs we can have different versions of this named demuxKv
etc.
From:
To: