Both sides had independently fixed the duplicate-declaration build break
(Basic.lean and Selective.lean each declared Parser, ParseResult, ParseError
and Location, and the root module imported both). Master resolved it by
gutting Selective.lean down to the class; this branch had resolved it the
other way, keeping an error-parameterized `Parser e t`.
Keep master's `Parser t` with the `parse` field: `ParseError` stays baked in,
which is simpler and matches Parsley, whose `Parsley[A]` has no error type
parameter. Drop the `Parser e t` variant entirely.
Carry over onto it the fixes that master does not have:
- The Monad instance's `pure` returned an empty remainder, discarding the
rest of the input. Thread the input through unchanged, as the monad laws
require and as the proof work will need.
- Give Selective's `select`/`branch` explicit type variables. They were
unbound identifiers, so Lean auto-bound them as parameters of the class
itself rather than as per-method implicits.
- Add the Selective instance for Parser, and a `branch` default in terms of
`select`, so instances need only supply `select`.
- Restore `expect`, which had been commented out when the types changed.
Implement `lift2` as `f <$> zip p1 p2`; it was a stub returning
`ParseResult.ok ("", "")` at type `Parser γ`, which did not compile, so
master's HEAD was red.
Bump the toolchain 4.29.1 -> 4.33.0; the slice API needed no changes.
Add CLAUDE.md describing the project's four stages and this state.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GPcEywkQGRifaT1VFXNRBL