@@ -119,7 +119,12 @@ module Streamly.Internal.Data.Parser.ParserD
119119 , takeWhile1
120120 , dropWhile
121121
122− -- ** Separators
122+ -- ** Single Element Separators
123+ -- | Separator could be in prefix postion ('takeStartBy'), or suffix
124+ -- position ('takeEndBy').
125+
126+ -- These can be implemented modularly with refolds, using takeWhile and
127+ -- satisfy.
123128 , takeEndBy
124129 , takeEndBy_
125130 , takeEndByEsc
@@ -944,6 +949,17 @@ takeWhile predicate (Fold fstep finitial fextract) =
944949
945950 extract s = fmap (Done 0) (fextract s)
946951
952+{-
953+-- XXX This may not be composable because of the b argument. We can instead
954+-- return a "Reparse b a m b" so that those can be composed.
955+{-# INLINE takeWhile1X #-}
956+takeWhile1 :: Monad m => b -> (a -> Bool) -> Refold m b a b -> Parser a m b
957+-- We can implement this using satisfy and takeWhile. We can use "satisfy
958+-- p", fold the result with the refold and then use the "takeWhile p" and
959+-- fold that using the refold.
960+takeWhile1 acc cond f = undefined
961+-}
962+
947963-- | Like 'takeWhile' but takes at least one element otherwise fails.
948964--
949965-- >>> takeWhile1 cond p = Parser.takeWhileP cond (Parser.takeBetween 1 maxBound p)