We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
https://discord.com/channels/864614189094928394/865401680497737758/1050733797278228500
@artemisSystem is there a combinator in parsing that works like many but accumulates in an arbitrary monoid? like this: manyMonoid ∷ ∀ s a. Monoid a ⇒ Parser s a → Parser s a manyMonoid = many >>> map fold
@artemisSystem is there a combinator in parsing that works like many but accumulates in an arbitrary monoid?
like this:
manyMonoid ∷ ∀ s a. Monoid a ⇒ Parser s a → Parser s a manyMonoid = many >>> map fold
manyMonoid p = tailRecM go empty where go accum = alt do x <- p pure (Loop (accum <> x)) do pure (Done accum)
See also https://pursuit.purescript.org/packages/purescript-arrays/7.1.0/docs/Data.Array#v:foldRecM
The text was updated successfully, but these errors were encountered:
No branches or pull requests
https://discord.com/channels/864614189094928394/865401680497737758/1050733797278228500
See also https://pursuit.purescript.org/packages/purescript-arrays/7.1.0/docs/Data.Array#v:foldRecM
The text was updated successfully, but these errors were encountered: