j-mie6 / parsley

A fast and modern parser combinator library for Scala
https://j-mie6.github.io/parsley/
BSD 3-Clause "New" or "Revised" License
173 stars 15 forks source link

Identity-based `local` #221

Open j-mie6 opened 8 months ago

j-mie6 commented 8 months ago

Sometimes, a local combinator just needs to restore an old state, as opposed to adjusting it on entry. This can be captured by reg.local(identity _)(p), but this could be more concisely represented as reg.local(p) -- so long as this does not cause inference problems with the existing local combinator that takes a Parsley[A => A]