Abstract
Generic Haskell is an extension of Haskell that supports the construction of generic programs. These lecture notes discuss three advanced generic programming applications: generic dictionaries, compressing XML documents, and the zipper: a data structure used to represent a tree together with a subtree that is the focus of attention, where that focus may move left, right, up or down the tree. When describing and implementing these examples, we will encounter some advanced features of Generic Haskell, such as type-indexed data types, dependencies between and generic abstractions of generic functions, adjusting a generic function using a default case, and generic functions with a special case for a particular constructor.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Abott, M., Altenkirch, T., Ghani, N., McBride, C.: Derivatives of containers. In: Hofmann, M.O. (ed.) TLCA 2003. LNCS, vol. 2701, pp. 16–30. Springer, Heidelberg (2003) (to appear)
Backhouse, R., Jansson, P., Jeuring, J., Meertens, L.: Generic programming: An introduction. In: Swierstra, S.D., Oliveira, J.N. (eds.) AFP 1998. LNCS, vol. 1608, pp. 28–115. Springer, Heidelberg (1999)
Bird, R., Gibbons, J.: Arithmetic coding with folds and unfolds. In: Jeuring, J., Jones, S.L.P. (eds.) AFP 2002. LNCS, vol. 2638, Springer, Heidelberg (2003) (to appear)
Cameron, R.D.: Source encoding using syntactic information source models. IEEE Transactions on Information Theory 34(4), 843–850 (1988)
Cannataro, M., Carelli, G., Pugliese, A., Sacca, D.: Semantic lossy compression of XML data. In: Knowledge Representation Meets Databases (2001)
Cheney, J.: Compressing xml with multiplexed hierarchical models. In: Proceedings of the 2001 IEEE Data Compression Conference, DCC 2001, pp. 163–172 (2001)
Claessen, K., Runciman, C., Chitil, O., Hughes, J., Wallace, M.: Testing and tracing lazy functional programs using Quickcheck and Hat. In: Jeuring, J., Jones, S.L.P. (eds.) AFP 2002. LNCS, vol. 2638, Springer, Heidelberg (2003) (to appear)
Clarke, D.: Towards GH(XML). Talk at the Generic Haskell meeting (2001), see, http://www.generic-haskell.org/talks.html
Clarke, D., Hinze, R., Jeuring, J., Löh, A., de Wit, J.: The Generic Haskell user’s guide. Technical Report UU-CS-2001-26, Utrecht University (2001), Also available from http://www.generic-haskell.org/
Clarke, D., Löh, A.: Generic Haskell, specifically. In: Gibbons, J., Jeuring, J. (eds.) Generic Programming, January 2003. IFIP, vol. 243, pp. 21–48. Kluwer Academic Publishers, Dordrecht (2003)
Connelly, R.H., Morris, F.L.: A generalization of the trie data structure. Mathematical Structures in Computer Science 5(3), 381–418 (1995)
XMLSolutions Corporation. XMLZip (1999), Available from http://www.xmlzip.com/
de la Briandais, R.: File searching using variable length keys. In: Proc. Western Joint Computer Conference, vol. 15, pp. 295–298. AFIPS Press (1959)
Evans, W.S., Fraser, C.W.: Bytecode compression via profiled grammar rewriting. In: SIGPLAN Conference on Programming Language Design and Implementation, pp. 148–155 (2001)
Franz, M.: Adaptive compression of syntax trees and iterative dynamic code optimization: Two basic technologies for mobile object systems. In: Mobile Object Systems: Towards the Programmable Internet, pp. 263–276. Springer, Heidelberg (1997)
Girardot, M., Sundaresan, N.: Millau: an encoding format for efficient representation and exchange of XML over the Web. In: IEEE International Conference on Multimedia and Expo (I) 2000, pp. 747–765 (2000)
Hagg, P.: A framework for developing generic XML Tools. Master’s thesis, Department of Information and Computing Sciences, Utrecht University (2002)
Hinze, R.: Generalizing generalized tries. Journal of Functional Programming 10(4), 327–351 (2000)
Hinze, R.: Generic Programs and Proofs, Habilitationsschrift, Bonn University (2000)
Hinze, R.: A new approach to generic functional programming. In: Conference Record of POPL 2000: The 27th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 119–132. ACM Press, New York (2000)
Hinze, R.: Polytypic values possess polykinded types. Science of Computer Programming 43(2-3), 129–159 (2002)
Hinze, R., Jeuring, J.: Generic Haskell: practice and theory, (2003) (to appear)
Hinze, R., Jeuring, J., Löh, A.: Type-indexed data types. In: Boiten, E.A., Möller, B. (eds.) MPC 2002. LNCS, vol. 2386, pp. 148–174. Springer, Heidelberg (2002)
Huet, G.: The zipper. Journal of Functional Programming 7(5), 549–554 (1997)
INC Intelligent Compression Technologies. XML-Xpress. (2001), Whitepaper available from http://www.ictcompress.com/products_xmlxpress.html
Jansson, P., Jeuring, J.: Polytypic compact printing and parsing. In: Swierstra, S.D. (ed.) ESOP 1999. LNCS, vol. 1576, pp. 273–287. Springer, Heidelberg (1999)
Jansson, P.: The WWW home page for polytypic programming (2001), Available from http://www.cs.chalmers.se/~patrikj/poly/
Jansson, P., Jeuring, J.: Functional pearl: Polytypic unification. Journal of Functional Programming 8(5), 527–536 (1998)
Jansson, P., Jeuring, J.: A framework for polytypic programming on terms, with an application to rewriting. In: Jeuring, J. (ed.) Workshop on Generic Programming 2000, Ponte de Lima, Portugal, July 2000, pp. 33–45 (2000); Utrecht Technical Report UU-CS-2000-19.
Jansson, P., Jeuring, J.: Polytypic data conversion programs. Science of Computer Programming 43(1), 35–75 (2002)
Jeuring, J.: Polytypic pattern matching. In: Conference Record of FPCA 1995, SIGPLAN-SIGARCH-WG2.8 Conference on Functional Programming Languages and Computer Architecture, pp. 238–248. ACM Press, New York (1995)
Jeuring, J., Hagg, P.: XComprez (2002), Available from http://www.generic-haskell.org/xmltools/XComprez/
Knuth, D.E.: The Art of Computer Programming, Volume 3: Sorting and Searching, 2nd edn. Addison-Wesley Publishing Company, Reading (1998)
Koopman, P., Alimarine, A., Tretmans, J., Plasmeijer, R.: Gast: Generic automated software testing. Submitted for publication (2002)
Lämmel, R., Jones, S.P.: Scrap your boilerplate: a practical approach to generic programming. In: Proc. ACM SIGPLAN Workshop on Types in Language Design and Implementation, TLDI 2003 (2003)
Liefke, H., Suciu, D.: XMill: an efficient compressor for XML data. In: Proceedings of the 2000 ACM SIGMOD International Conference on Management of Data, pp. 153–164 (2000)
Löh, A., Clarke, D., Jeuring, J.: Generic Haskell, naturally: The language and its type system (2003) (in preparation)
Malcolm, G.: Data structures and program transformation. Science of Computer Programming 14, 255–279 (1990)
McBride, C.: The derivative of a regular type is its type of one-hole contexts (2001) (unpublished manuscript)
Meertens, L.: Paramorphisms. Formal Aspects of Computing 4(5), 413–425 (1992)
Meertens, L.: Functor pulling. In: Workshop on Generic Programming (WGP 1998), Marstrand, Sweden (June 1998)
Meijer, E., Fokkinga, M.M., Paterson, R.: Functional programming with bananas, lenses, envelopes, and barbed wire. In: Hughes, J. (ed.) FPCA 1991. LNCS, vol. 523, pp. 124–144. Springer, Heidelberg (1991)
Okasaki, C.: Purely Functional Data Structures. Cambridge University Press, Cambridge (1998)
Okasaki, C., Gill, A.: Fast mergeable integer maps. In: The 1998 ACM SIGPLAN Workshop on ML, Baltimore, Maryland, pp. 77–86 (1998)
Jones, S.P., Hughes, J., Augustsson, L., Barton, D., Boutel, B., Burton, W., Fraser, S., Fasel, J., Hammond, K., Hinze, R., Hudak, P., Johnsson, T., Jones, M., Launchbury, J., Meijer, E., Peterson, J., Reid, A., Runciman, C., Wadler, P.: Haskell 1998 — A non-strict, purely functional language (February 1999), Available from http://www.haskell.org/definition/
Stork, C.H., Haldar, V.V., Franz, M.: Generic adaptive syntax-directed compression for mobile code. Technical Report 00-42, Department of Information and Computer Science, University of California, Irvine (2000)
Thue, A.: Über die gegenseitige lage gleicher teile gewisser zeichenreihen. Skrifter udgivne af Videnskaps-Selskabet i Christiania, Mathematisk-Naturvidenskabelig Klasse 1, 1–67 (1912); Reprinted in Thue’s Selected Mathematical Papers, pp. 413–477. Universitetsforlaget, Oslo (1977)
Tolani, P., Haritsa, J.R.: XGRIND: A query-friendly XML compressor. In: ICDE (2002)
W3C. XML 1.0 (1998), Available from http://www.w3.org/XML/
Wadsworth, C.P.: Recursive type operators which are more than type schemes. Bulletin of the EATCS 8, 87–88 (1979); Abstract of a talk given at the 2nd International Workshop on the Semantics of Programming Languages, Bad Honnef, Germany, March 19–23 (1979)
Wallace, M., Runciman, C.: Haskell and XML: Generic combinators or type-based translation? In: International Conference on Functional Programming, pp. 148–159 (1999)
Ziv, J., Lempel, A.: A universal algorithm for sequential data compression. IEEE Transactions on Information Theory 23(3), 337–343 (1977)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2003 Springer-Verlag Berlin Heidelberg
About this chapter
Cite this chapter
Hinze, R., Jeuring, J. (2003). Chapter 2. Generic Haskell: Applications. In: Backhouse, R., Gibbons, J. (eds) Generic Programming. Lecture Notes in Computer Science, vol 2793. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-45191-4_2
Download citation
DOI: https://doi.org/10.1007/978-3-540-45191-4_2
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-20194-6
Online ISBN: 978-3-540-45191-4
eBook Packages: Springer Book Archive