1. Bryan O'Sullivan
  2. attoparsec

Commits

Lennart Kolmodin  committed b0bb818

Implement <?>

  • Participants
  • Parent commits 42063d3
  • Branches default

Comments (0)

Files changed (1)

File Data/Attoparsec/Internal.hs

View file
  • Ignore whitespace
 (<?>) :: Parser a
       -> String                 -- ^ the name to use if parsing fails
       -> Parser a
-p <?> _msg = p
+p <?> msg = Parser $ \s kf ks -> runParser p s (\s' strs m -> kf s' (msg:strs) m) ks
 {-# INLINE (<?>) #-}
 infix 0 <?>