July 2023
Intermediate to advanced
670 pages
17h 13m
English
So far you’ve successfully unpacked a single FileData value using your Applicative parser, but to unpack an entire archive we need to support being able to decode an entire list of values. In theory, this shouldn’t be too hard, as we’ve been working with lists since the first chapter of this book, but the fact that we’re now dealing with parsers instead of plain lists means we need to think a bit differently about how we build support for decoding values.
Fundamentally, what we’d like to do is to have our user give us a way of parsing a single element, and we’d then like to use that parser to parse as many elements as there are in the input we’re given.
One way to do this is build our own recursive parser that will ...