Skip to content

debug function #115

Closed
Closed
@flip111

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?

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions