liveBook · Manning

Many

As explained in Learn Haskell by Example

many is an Alternative operation that applies an applicative computation zero or more times and collects the successful results.

many repeatedly applies an Applicative computation until it fails, collecting successful results in a list. It represents zero or more occurrences: an immediate failure produces an empty list instead of failing. section 12.1.4

Collect repeated parser matches

With a parser for the string "A", many collects every successful match: runParser (many $ string "A") "AAA" produces ["A","A","A"], while an empty input produces []. Use some instead when at least one match is required. section 12.1.4

How Learn Haskell by Example covers it

How deep it goes
Explains repetition, failure behavior, list collection, and a defining expression, but stops short of implementation internals.
Examples
Demonstrates repeated "A" parsing, empty input, and a contrast with a parser requiring at least one space.
What it assumes
Uses Applicative and Alternative parser operations while distinguishing many from some.
What you can do after
Apply it via Control.Applicative to collect zero or more successful parser results.
How it connects
Connects Alternative with Applicative, (<|>), some, and parser combinators.

This explainer was generated by Manning's knowledge graph from the text of Learn Haskell by Example. The section links point to the parts of the book it draws on.