Abstract
We present an extension of Haskell, baptized XHaskell, which combines parametric polymorphism, algebraic data types and type classes found in Haskell with regular expression types, subtyping and regular expression pattern matching found in XDuce. Such an extension proves in particular useful for the type-safe processing of XML data. For example, we can express XQuery and XPath style features via XHaskell combinators. We have implemented the system which can be used in combination with the Glasgow Haskell Compiler.
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
Benzaken, V., Castagna, G., Frisch, A.: CDuce: An XML-centric general-purpose language. In: Proc. of ICFP 2003, pp. 51–63. ACM Press, New York (2003)
Bierman, G., Meijer, E., Schulte, W.: The essence of data access in c ω . In: Black, A.P. (ed.) ECOOP 2005. LNCS, vol. 3586, pp. 287–311. Springer, Heidelberg (2005)
Broberg, N., Farre, A., Svenningsson, J.: Regular expression patterns. In: Proc. of ICFP 2004, pp. 67–78. ACM Press, New York (2004)
Frisch, A.: OCaml + XDuce. In: Proc. of ICFP 2006, pp. 192–200. ACM Press, New York (2006)
Colazzo, D., Castagna, G., Frisch, A.: Error mining for regular expression patterns. In: the 9th Italian Conference On Theoretical Computer Science, pp. 160–172. Springer, Heidelberg (2005)
Gapeyev, V., Pierce, B.C.: Regular object types. In: Cardelli, L. (ed.) ECOOP 2003. LNCS, vol. 2743, pp. 151–175. Springer, Heidelberg (2003); A preliminary version was presented at FOOL 2003
Ghc as a library, http://www.haskell.org/haskellwiki/GHC/As_a_library
Hall, C.V., Hammond, K., Peyton Jones, S.L., Wadler, P.L.: Type classes in Haskell. ACM Transactions on Programming Languages and Systems 18(2), 109–138 (1996)
Hosoya, H.: Regular expressions pattern matching: a simpler design (2003)
Hosoya, H., Frisch, A., Castagna, G.: Parametric polymorphism for XML. In: Proc. of POPL 2005, pp. 50–62. ACM Press, New York (2005)
Hosoya, H., Pierce, B.C.: XDuce: A typed XML processing language (preliminary report). In: Suciu, D., Vossen, G. (eds.) WebDB 2000. LNCS, vol. 1997, pp. 226–244. Springer, Heidelberg (2001)
Hosoya, H., Pierce, B.C.: Regular expression pattern matching for XML. In: Proc. of POPL 2001, pp. 67–80. ACM Press, New York (2001)
Hosoya, H., Vouillon, J., Pierce, B.C.: Regular expression types for XML. ACM Trans. Program. Lang. Syst. 27(1), 46–90 (2005)
Kempa, M., Linnemann, V.: Type checking in XOBE. In: Proc. Datenbanksysteme fur Business, Technologie und Web, BTW 2003. LNI, pp. 227–246. GI (2003)
Kirkegaard, C., Møller, A., Schwartzbach, M.I.: Static analysis of XML transformations in Java. IEEE Transaction on Software Engineering 30(3), 181–0_6 (2004)
Kiselyov, O.: HSXML: Typed SXML (2007), http://okmij.org/ftp/Scheme/xml.html#typed-SXML
Kiselyov, O., Lämmel, R.: Haskell’s overlooked object system. Draft; Submitted for journal publication; online since (September 30, 2004); Full version released (September 10, 2005) (2005)
Lu, K.Z.M., Sulzmann, M.: An implementation of subtyping among regular expression types. In: Chin, W.-N. (ed.) APLAS 2004. LNCS, vol. 3302, pp. 57–73. Springer, Heidelberg (2004)
Meijer, E., Shields, M.: XMλ: A functional language for constructing and manipulating XML documents (Draft) (1999)
Pierce, B.C., Turner, D.N.: Local type inference. ACM Transactions on Programming Languages and Systems 22(1), 1–44 (2000)
Schmidt, U.: Haskell XML Toolbox (2007), http://www.fh-wedel.de/~si/HXmlToolbox
Shields, M., Meijer, E.: Type-indexed rows. In: Proc. of POPL 2001, pp. 261–275. ACM Press, New York (2001)
Stuckey, P.J., Sulzmann, M., Wazny, J.: The Chameleon type debugger. In: Proc. of Fifth International Workshop on Automated Debugging (AADEBUG 2003). Computer Research Repository, pp. 247–258 (2003), http://www.acm.org/corr/
Stuckey, P.J., Sulzmann, M., Wazny, J.: Type processing by constraint reasoning. In: Kobayashi, N. (ed.) APLAS 2006. LNCS, vol. 4279, pp. 1–25. Springer, Heidelberg (2006)
Sulzmann, M., Lu, K.Z.M.: XHaskell – adding regular expression types to Haskell. Technical report, National University of Singapore (June 2007), http://www.comp.nus.edu.sg/~sulzmann/manuscript/xhaskell-tr.ps
Sulzmann, M., Wazny, J.: Chameleon, www.comp.nus.edu.sg/sulzmann/chameleon
Thiemann, P.: A typed representation for HTML and XML documents in Haskell. Journal of Functional Programming 12(4-5), 435–468 (2002)
Vouillon, J.: Polymorphic regular tree types and patterns. In: Proc. of POPL 2006, pp. 103–114. ACM Press, New York (2006)
Wallace, M., Runciman, C.: Haskell and XML: Generic combinators or type-based translation? In: ICFP 1999, pp. 148–159. ACM Press, New York (1999)
Xhaskell, http://xhaskell.googlecode.com
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 2008 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Sulzmann, M., Lu, K.Z.M. (2008). XHaskell – Adding Regular Expression Types to Haskell. In: Chitil, O., Horváth, Z., Zsók, V. (eds) Implementation and Application of Functional Languages. IFL 2007. Lecture Notes in Computer Science, vol 5083. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-85373-2_5
Download citation
DOI: https://doi.org/10.1007/978-3-540-85373-2_5
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-85372-5
Online ISBN: 978-3-540-85373-2
eBook Packages: Computer ScienceComputer Science (R0)