many package:fused-effects

Zero or more.
many m = some m <|> pure []
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.