Abstract
We implement statically-typed multi-holed contexts in OCaml using an underlying algebraic datatype augmented with phantom types. Existing approaches require dynamic checks or more complex type systems. In order to support concatenation we use two type parameters to represent the number of holes in a context as the difference between two Peano numbers. In order to support plugging a context with contexts of different arity we introduce a datatype of lists of contexts of length n with a total of m holes. Further, we extend our representation to allow holes to be marked with additional type information. As an example, we use these marks to implement statically-typed multi-holed XHTML contexts. We take advantage of Garrigue's relaxed value restriction.
Original language | English |
---|---|
Title of host publication | ML '08: Proceedings of the 2008 ACM SIGPLAN workshop on ML |
Publisher | Association for Computing Machinery |
Pages | 59-68 |
Number of pages | 10 |
ISBN (Print) | 9781605580623 |
DOIs | |
Publication status | Published - Sept 2008 |
Event | 2008 ACM SIGPLAN workshop - Victoria, Canada Duration: 21 Sept 2008 → 21 Sept 2008 |
Conference
Conference | 2008 ACM SIGPLAN workshop |
---|---|
Country/Territory | Canada |
City | Victoria |
Period | 21/09/08 → 21/09/08 |