Generic parsing combinators - Martínez López, Pablo E. (1997)
Parsing combinators are a well known technique to the functional programming com munity Several de nitions of them were proposed and each one has its own advantages From the programmer point of view this wide range of possibilities implies that she needs to mantain several di erent modules with several di erent namespaces but all aimed to solve the same problem Type classes and constructor classes were introduced in Functional Programming as a mean to provide overloading that is sharing of names between functions of di erent types Several design decisions can be made when implementing class systems In particular multi parameter type classes is a di cult feature to add and its addition makes sense only if extra expressiveness is achieved with them This paper proposes the use of the class system extended with multi parameter type classes to unify the de nition of parsing combinators The advantage is that di erent solutions can share their interfaces thus simplifying the programmer s activity She uses this common interface and the actual implementation is decided only changing the type signature Moreover this use of the class system is an example of the usefulness of multi parameter type classes