eof package:flatparse

Succeed if the input is empty.
Succeed if the input is empty.
takeOffAddr# addr# offset# len# moves to addr#, skips offset# bytes, reads len# bytes into a ByteString, and restores the original address. The Addr# should be from withAddr#. Useful for parsing offset-based data tables. Ex: Your file contains an index storing (OFFSET, LENGTH) entries where the offset is the byte position in the file. Begin with withAddr# $ tableBase# -> ..., then read each entry like takeOffAddr# tableBase# OFFSET LENGTH. Fails if you attempt to read outside the input. Undefined behaviour if offset# or len# is negative. Name adopted from the similar-ish indexXOffAddr# primops.
takeOffAddr# addr# offset# len# moves to addr#, skips offset# bytes, reads len# bytes into a ByteString, and restores the original address. The Addr# should be from withAddr#. Useful for parsing offset-based data tables. Ex: Your file contains an index storing (OFFSET, LENGTH) entries where the offset is the byte position in the file. Begin with withAddr# $ tableBase# -> ..., then read each entry like takeOffAddr# tableBase# OFFSET LENGTH. Fails if you attempt to read outside the input. Undefined behaviour if offset# or len# is negative. Name adopted from the similar-ish indexXOffAddr# primops.