many -package:streamly-core

Zero or more.

Examples

>>> many (putStr "la")
lalalalalalalalala... * goes on forever *
>>> many Nothing
Just []
>>> take 5 <$> many (Just 1)
* hangs forever *
Note that this function can be used with Parsers based on Applicatives. In that case many parser will attempt to parse parser zero or more times until it fails.
Parses zero or more occurrences of the given parser.
many p applies the parser p zero or more times. Returns a list of the returned values of p.
identifier  = do{ c  <- letter
; cs <- many (alphaNum <|> char '_')
; return (c:cs)
}
Collapse multiple values in to one.
Keep parsing elements as long as the parser returns Just.
many p applies the parser p zero or more times. Returns a list of the returned values of p.
identifier  = do{ c  <- letter
; cs <- many (alphaNum <|> char '_')
; return (c:cs)
}
Zero or more.
many p applies the parser p zero or more times and returns a list of the values returned by p.
identifier = (:) <$> letter <*> many (alphaNumChar <|> char '_')
Zero or more.
many m = some m <|> pure []
Encode many displays into a single one. All will be output.
Deliver zero or more values of a.
Same as the usual many except a Format is no Functor, let alone Alternative.
Parse many of something. Behaves like * in regexes. This eats as much as it possibly can, if you want a minimal much rule, then use manyUntil which stops when a.
Many values collapsed (many or many_)
Concatenate a series of rendering actions.
The parser parsed and converted zero or more records. Any records that failed type conversion are returned as Left errMsg and the rest as Right val. Feed a ByteString to the continuation to continue parsing. Use an empty string to indicate that no more input data is available. If fed an empty string, the continuation is guaranteed to return either Fail or Done.