Abstract
Prior papers have presented a fusion framework called stream fusion for removing intermediate data structures from both lists and arrays in Haskell. Stream fusion is unique in using an explicit datatype to accomplish fusion. We demonstrate how this can be exploited in the creation of a new Haskell string representation Text, which achieves better performance and data density than String. Text uses streams not only to accomplish fusion, but also as a way to abstract away from various underlying representations. This allows the same set of combinators to manipulate Unicode text that is stored in a variety of ways.
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
Peyton-Jones, S.: The Haskell 98 Report (2002)
The GHC Team: The Glorious Glasgow Haskell Compilation System User’s Guide, Version 6.12.1
Coutts, D., Stewart, D., Leshchinskiy, R.: Rewriting Haskell Strings. In: Hanus, M. (ed.) PADL 2007. LNCS, vol. 4354, pp. 50–64. Springer, Heidelberg (2006)
Coutts, D., Leshchinskiy, R., Stewart, D.: Stream Fusion: From Lists to Streams to Nothing At All. In: ICFP 2007. ACM, New York (October 2007)
The Unicode Consortium: The Unicode Standard, Version 5.2.0 (2010)
Gill, A., Launchbury, J., Peyton-Jones, S.: A Short Cut to Deforestation. In: ICFP 1993, pp. 223–232. ACM, New York (1993)
Svenningsson, J.: Shortcut fusion for accumulating parameters & zip-like functions. In: ICFP 2002, pp. 124–132. ACM, New York (2002)
Petyon-Jones, S., Tolmach, A., Hoare, T.: Playing by the Rules: Rewriting as a practical optimisation technique in GHC. In: Haskell Workshop, ACM SIGPLAN, pp. 203–233 (2001)
Harper, T.: Fusion on Haskell Unicode Strings, Master’s Thesis, University of Oxford (2008)
Claessen, K., Hughes, J.: QuickCheck: a lightweight tool for random testing of Haskell programs. In: ICFP 2000. ACM, New York (2000)
Hinze, R., Paterson, R.: Finger trees: a simple general-purpose data structure. Journal of Functional Programming 16(2) (2006)
Boehm, H.J., Atkinson, R., Plass, M.: Ropes: an Alternative to Strings. Software: Practice and Experience 25(12), 1315–1330 (1995)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2010 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Harper, T. (2010). Stream Fusion on Haskell Unicode Strings. In: Morazán, M.T., Scholz, SB. (eds) Implementation and Application of Functional Languages. IFL 2009. Lecture Notes in Computer Science, vol 6041. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-16478-1_8
Download citation
DOI: https://doi.org/10.1007/978-3-642-16478-1_8
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-16477-4
Online ISBN: 978-3-642-16478-1
eBook Packages: Computer ScienceComputer Science (R0)