Rewriting haskell strings

  • Authors:
  • Duncan Coutts;Don Stewart;Roman Leshchinskiy

  • Affiliations:
  • Programming Tools Group, Oxford University Computing Laboratory;Computer Science & Engineering, University of New South Wales;Computer Science & Engineering, University of New South Wales

  • Venue:
  • PADL'07 Proceedings of the 9th international conference on Practical Aspects of Declarative Languages
  • Year:
  • 2007

Quantified Score

Hi-index 0.00

Visualization

Abstract

The Haskell String type is notoriously inefficient. We introduce a new data type, ByteString, based on lazy lists of byte arrays, combining the speed benefits of strict arrays with lazy evaluation. Equational transformations based on term rewriting are used to deforest intermediate ByteStrings automatically. We describe novel fusion combinators with improved expressiveness and performance over previous functional array fusion strategies. A library for ByteStrings is implemented, providing a purely functional interface, which approaches the speed of low-level mutable arrays in C.