Skip to content

Export runParserT' #166

New issue

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

Merged
merged 1 commit into from
Mar 28, 2022
Merged

Export runParserT' #166

merged 1 commit into from
Mar 28, 2022

Conversation

JordanMartinez
Copy link
Contributor

Description of the change

Exports runParserT'. This fix is needed to fix an issue in the purescript-uri package as discovered in purescript/package-sets#1075 (comment).

wrapParser
  :: forall s m a b
   . Monad m
  => (a -> Either URIPartParseError b)
  -> ParserT s m a
  -> ParserT s m b
wrapParser parseA p = ParserT do
-  ParseState _ pos _ <- get
-  a <- un ParserT p
+  st@(ParseState _ pos _) <- get
+  a <- runParserT' st p
  case parseA a of
    Left (URIPartParseError err) -> throwError (ParseError err pos)
    Right b -> pure b

Checklist:

  • Added the change to the changelog's "Unreleased" section with a link to this PR and your username
  • Linked any existing issues or proposals that this pull request should close
  • Updated or added relevant documentation in the README and/or documentation directory
  • Added a test for the contribution (if applicable)

@JordanMartinez
Copy link
Contributor Author

🏓 @thomashoneyman

@JordanMartinez JordanMartinez merged commit 8283d3e into purescript-contrib:main Mar 28, 2022
@JordanMartinez JordanMartinez deleted the export-runParsertTPrime branch March 28, 2022 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants