haskell / attoparsec

A fast Haskell library for parsing ByteStrings
http://hackage.haskell.org/package/attoparsec
Other
514 stars 93 forks source link

Add startOfInput #187

Open singpolyma opened 3 years ago

singpolyma commented 3 years ago
startOfInput :: Parser t ()
startOfInput = Parser $ \t pos more lose succ ->
    if pos == 0 then
        succ t pos more ()
    else
        lose t pos more [] "startOfInput"