
28 Jun
2021
28 Jun
'21
11:37 a.m.
Hi. I've used attoparsec before and it can return 'Partial' result containing continuation, which is able to continue parsing if provided with more input. E.g. > let A.Partial c1 = A.parse (A.string "mac address") "mac "; in c1 "address" Done "" "mac address" Does the same thing possible with megaparsec? After looking through library API, i haven't find a way to do this. 'runParser' (which seems the only way to run megaparsec parser) fails on incomplete (text) input. And if that's not possible, how should i deal with chunked input? E.g. i read from a socket with 'recv' and i don't want to read all data at once. How can i suspend parsing for a time, read next chunk and continue? Thanks.