Type-safe, self inspecting code

  • Authors:
  • Arthur I. Baars;S. Doaitse Swierstra

  • Affiliations:
  • Utrecht University, Utrecht, The Netherlands;Utrecht University, Utrecht, The Netherlands

  • Venue:
  • Haskell '04 Proceedings of the 2004 ACM SIGPLAN workshop on Haskell
  • Year:
  • 2004

Quantified Score

Hi-index 0.01

Visualization

Abstract

We present techniques for representing typed abstract syntax trees in the presence of observable recursive structures. The need for this arose from the desire to cope with left-recursion in combinator based parsers. The techniques employed can be used in a much wider setting however, since it enables the inspection and transformation of any program structure, which contains internal references. The hard part of the work is to perform such analyses and transformations in a setting in which the Haskell type checker is still able to statically check the correctness of the program representations, and hence the type correctness of the transformed program.