On Sat, Jul 05, 2014 at 10:32:53AM +1000, Christian Marie wrote: > Right, I would have found that very useful. I would need an accumulator to > keep > state, so something like? > > takesWhile' :: Monad m > => (acc -> a -> Bool) > -> acc > -> Lens' (Producer a m x) (FreeT (Producer a m) m x)
I have decided that "takes" is a misnomer here, as nothing is ever dropped, it's not synonymous with how a list takeWhile would work. It is in fact, closer to: Data.List.Split.splitWhen :: (a -> Bool) -> [a] -> [[a]] So pershaps naming it splitsWhenAcc and splitsWhen? -- Christian Marie - Sparkly Code Princess
pgptO6cv6f30f.pgp
Description: PGP signature
