A Library for Processing Ad hoc Data in Haskell

Embedding a Data Description Language
  • Yan Wang
  • Verónica Gaspes
Part of the Lecture Notes in Computer Science book series (LNCS, volume 5836)


Ad hoc data formats, i.e. semistructured non-standard data formats, are pervasive in many domains that need software tools — bioinformatics, demographic surveys, geophysics and network software are just a few. Building tools becomes easier if parsing and other standard input-output processing can be automated. Modern approaches for dealing with ad hoc data formats consist of domain specific languages based on type systems. Compilers for these languages generate data structures and parsing functions in a target programming language in which tools and applications are then written. We present a monadic library in Haskell that implements a data description language. Using our library, Haskell programmers have access to data description primitives that can be used for parsing and that can be integrated with other libraries and application programs without the need of yet another compiler.


Target Language Input Stream Semantic Constraint Physical Layout Parser Generator 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Pads, ( [Online]; accessed June 22, 2008)
  2. 2.
    Pcap, ( [Online]; accessed October 10, 2008)
  3. 3.
    Back, G.: DataScript - A specification and scripting language for binary data. In: Batory, D., Blum, A., Taha, W. (eds.) GPCE 2002. LNCS, vol. 2487, pp. 66–77. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  4. 4.
    Fernández, M.F., Fisher, K., Foster, J.N., Greenberg, M., Mandelbaum, Y.: A Generic Programming Toolkit for PADS/ML: First-Class Upgrades for Third-Party Developers. In: Hudak, P., Warren, D.S. (eds.) PADL 2008. LNCS, vol. 4902, pp. 133–149. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  5. 5.
    Fisher, K., Gruber, R.: Pads: a domain-specific language for processing ad hoc data. In: PLDI 2005: Proceedings of the 2005 ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 295–304. ACM Press, New York (2005)CrossRefGoogle Scholar
  6. 6.
    Fisher, K., Mandelbaum, Y., Walker, D.: The next 700 data description languages. In: POPL 2006, pp. 2–15. ACM Press, New York (2006)Google Scholar
  7. 7.
    Fisher, K., Walker, D., Zhu, K.Q., White, P.: From dirt to shovels: fully automatic tool generation from ad hoc data. In: POPL 2008, pp. 421–434. ACM, New York (2008)Google Scholar
  8. 8.
    Hughes, J.: The design of a pretty-printing library. In: First International Spring School on Advanced Functional Programming Techniques-Tutorial Text, pp. 53–96. Springer, London (1995)Google Scholar
  9. 9.
    Hutton, G., Meijer, E.: Monadic parsing in Haskell. Journal of Functional Programming 8(4), 437–444 (1998)Google Scholar
  10. 10.
    Kennedy, A.J.: Pickler combinators. Journal of Functional Programming 14(6), 727–739 (2004)Google Scholar
  11. 11.
    Leijen, D., Meijer, E.: Parsec: Direct style monadic parser combinators for the real world. Tech. Rep. UU-CS-2001-27, Department of Computer Science, Universiteit Utrecht (2001)Google Scholar
  12. 12.
    McCann, P.J., Chandra, S.: Packet types: Abstract specification of network protocol messages. SIGCOMM Comput. Commun. Rev. 30(4), 321–333 (2000)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2011

Authors and Affiliations

  • Yan Wang
    • 1
  • Verónica Gaspes
    • 1
  1. 1.Halmstad UniversitySweden

Personalised recommendations