-- | Constructs list from upstream values while the predicate holds (and while there are any values left).
-- If you want to pipe the values instead of accumulating them, use isolateWhile.
-- This function is semantically equivalent to:
--
-- > isolateWhile pr =$ consume
-- 
takeWhile :: Monad m => (a -> Bool) -> C.Sink a m [a]
takeWhile pr = isolateWhile pr C.=$ C.consume
takeWhile :: Monad m => (a -> Bool) -> C.Sink a m [a]
takeWhile pr = isolateWhile pr C.=$ C.consume
takeWhile pr = isolateWhile pr C.=$ C.consume