Abstract
We introduce a novel implementation of subtyping among regular expression types in terms of Haskell-style type classes by making use of some modest type class extensions. We assume that each regular expression type has some underlying structured runtime representation. Hence, we not only check for the containment problem among regular expressions, but also automatically derive some appropriate casting functions among the underlying structured values. We believe that this work is the first step in adding type-safe XML support to languages such as Haskell.
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
Aiken, A., Murphy, B.: Implementing regular tree expressions. In: Hughes, J. (ed.) FPCA 1991. LNCS, vol. 523, pp. 427–447. Springer, Heidelberg (1991)
Antimirov, V.M.: Rewriting regular inequalities. In: Reichel, H. (ed.) FCT 1995. LNCS, vol. 965, pp. 116–125. Springer, Heidelberg (1995)
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)
Crary, K.: Foundations for the implementation of higher-order subtyping. In: Proc. of ICFP 1997, pp. 125–135. ACM Press, New York (1997)
Duck, G.J., Peyton-Jones, S., Stuckey, P.J., Sulzmann, M.: Sound and decidable type inference for functional dependencies. In: Schmidt, D. (ed.) ESOP 2004. LNCS, vol. 2986, pp. 49–63. Springer, Heidelberg (2004)
Frisch, A., Cardelli, L.: Greedy regular expression matching. In: PLAN-X 2004 Informal Proceedings (2004)
Glasgow Haskell compiler home page, http://www.haskell.org/ghc/
Hall, C.V., Hammond, K., Peyton Jones, S., Wadler, P.: Type classes in Haskell. In: Sannella, D. (ed.) ESOP 1994. LNCS, vol. 788, pp. 241–256. Springer, Heidelberg (1994)
Hosoya, H.: Regular Expression Types for XML. PhD thesis, The University of Tokyo (December 2000)
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 SIGPLAN Notices 35(9), 11–22 (2000)
Jones, M.P.: Type classes with functional dependencies. In: Smolka, G. (ed.) ESOP 2000. LNCS, vol. 1782, p. 230. Springer, Heidelberg (2000)
Kempa, M., Linnemann, V.: Type checking in XOBE. In: Proc. Datenbanksysteme fur Business, Technologie und Web, BTW 2003, LNI, pp. 227–246, GI (2003)
Lu, K.Z.M., Sulzmann, M.: XHaskell (2004), http://www.comp.nus.edu.sg/~luzm/xhaskell
Lu, K.Z.M., Sulzmann, M.: An implementation of subtyping among regular expression types. Technical report, The National University of Singapore (2004), http://www.comp.nus.edu.sg/~luzm/xhaskell/tr-impsubtype.ps
Neubauer, M., Thiemann, P., Gasbichler, M., Sperber, M.: Functional logic overloading. In: Proc. of POPL 2002, pp. 233–244. ACM Press, New York (2002)
Peyton Jones, S., et al.: Report on the programming language Haskell 98 (February 1999), http://haskell.org
Stuckey, P.J., Sulzmann, M.: A theory of overloading. In: Proc. of ICFP 2002, pp. 167–178. ACM Press, New York (2002)
Stuckey, P.J., Sulzmann, M., Wazny, J.: Interactive type debugging in Haskell. In: Proc. of Haskell Workshop 2003, pp. 72–83. ACM Press, New York (2003)
Sulzmann, M., Wazny, J.: The Chameleon system (July 2004), http://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)
Wallace, M., Runciman, C.: Haskell and XML: Generic combinators or type-based translation? In: ICFP 1999, pp. 148–159. ACM Press, New York (1999)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2004 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Lu, K.Z.M., Sulzmann, M. (2004). An Implementation of Subtyping Among Regular Expression Types. In: Chin, WN. (eds) Programming Languages and Systems. APLAS 2004. Lecture Notes in Computer Science, vol 3302. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-30477-7_5
Download citation
DOI: https://doi.org/10.1007/978-3-540-30477-7_5
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-23724-2
Online ISBN: 978-3-540-30477-7
eBook Packages: Springer Book Archive