j-mie6 / gigaparsec

Refreshed parsec-style library for compatibility with Scala parsley
https://j-mie6.github.io/gigaparsec/
BSD 3-Clause "New" or "Revised" License
16 stars 4 forks source link

`manyMap` and `someMap` #12

Closed j-mie6 closed 11 months ago

j-mie6 commented 1 year ago

These two combinators are analogies for the foldMap function, allowing for collapsing of Monoid and Semigroup structures:

manyMap :: Monoid m => (a -> m) -> Parsec a -> Parsec m
someMap :: Semigroup s => (a -> s) -> Parsec a -> Parsec s

These can both be implemented in terms of manyr and somer