Data structures and program transformation
Science of Computer Programming
Journal of Functional Programming
Applicative programming with effects
Journal of Functional Programming
Journal of Functional Programming
Type checking with open type functions
Proceedings of the 13th ACM SIGPLAN international conference on Functional programming
A lightweight approach to datatype-generic rewriting
Proceedings of the ACM SIGPLAN workshop on Generic programming
Generic programming with fixed points for mutually recursive datatypes
Proceedings of the 14th ACM SIGPLAN international conference on Functional programming
Proceedings of the 6th ACM SIGPLAN workshop on Generic programming
Proceedings of the 6th ACM SIGPLAN workshop on Generic programming
Proceedings of the seventh ACM SIGPLAN workshop on Generic programming
Generic representations of tree transformations
Proceedings of the 9th ACM SIGPLAN workshop on Generic programming
Hi-index | 0.00 |
Tools for computer languages need position information: compilers for providing better error messages, structure editors for mapping between structural and textual views, and debuggers for navigating through a term, for instance. Manually adding position information to an abstract syntax tree is tedious and requires pervasive changes: the original tree becomes verbose and every function operating on it needs to be adapted. In this paper, we describe how to automatically extend datatypes with position information using datatype-generic programming techniques. Furthermore, we show examples of how to use this position information: parsers that automatically construct trees annotated with positions, catamorphisms that deal with failure by reporting error locations, and zippers that efficiently navigate annotated trees. The generic programming technique we describe is applicable to a wide range of domains.