Skip to content

debug function #115

Description

@flip111

for attoparsec i was using this debug function

debug :: Parser a -> Parser a
debug p = do
  (consumed, a) <- match p
  remaining <- lookAhead takeText
  traceM ("consumed: " ++ show consumed)
  traceM ("remaining: " ++ show remaining)
  return a

I couldn't find an equivalent function for match and takeText. How can i debug a parser written with megaparsec?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions