[Finish up chapter 10. Bryan O'Sullivan **20071111005508] { hunk ./en/ch10-binary.xml 4 - Code case study: parsing a binary file format + Code case study: parsing a binary data format hunk ./en/ch10-binary.xml 648 + + + Conclusions + + In this chapter, we started with a naive file parser, and + successively refined it into code that is at once less brittle + and more general. Although our initial task was parsing + graphics files, the combinator-based library that we developed + along the way is not tied to graphics. + + Our main theme in this chapter has been abstraction. We + found passing explicit state down a chain of functions to be + unsatisfactory, so we abstracted this detail away. We noticed + some recurring needs as we worked out our parsing code, and + abstracted those into common functions. Along the way, we + introduced the notion of a functor as offering a generalised way + to map over a container type. + + We will revisit parsing in , to + discuss Parsec, a widely used and flexible parsing library. And + in , we will return to our theme of + abstraction. + hunk ./en/ch10-binary.xml 675 -sgml-parent-document: ("00book.xml" "book") +sgml-parent-document: ("00book.xml" "chapter") }