The system F of variable types, fifteen years later
Theoretical Computer Science
Computational lambda-calculus and monads
Proceedings of the Fourth Annual Symposium on Logic in computer science
Dynamic typing in a statically typed language
ACM Transactions on Programming Languages and Systems (TOPLAS)
Partial evaluation and automatic program generation
Partial evaluation and automatic program generation
Dynamic typing: syntax and proof theory
ESOP'92 Selected papers of the symposium on Fourth European symposium on programming
Compiling polymorphism using intensional type analysis
POPL '95 Proceedings of the 22nd ACM SIGPLAN-SIGACT symposium on Principles of programming languages
ACM Transactions on Programming Languages and Systems (TOPLAS)
Putting type annotations to work
POPL '96 Proceedings of the 23rd ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Type-directed partial evaluation
POPL '96 Proceedings of the 23rd ACM SIGPLAN-SIGACT symposium on Principles of programming languages
A modal analysis of staged computation
POPL '96 Proceedings of the 23rd ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Multi-stage programming (poster)
ICFP '97 Proceedings of the second ACM SIGPLAN international conference on Functional programming
Relational parametricity and units of measure
Proceedings of the 24th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
PolyP—a polytypic programming language extension
Proceedings of the 24th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
First-class polymorphism with type inference
Proceedings of the 24th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Dynamic typing as staged type inference
POPL '98 Proceedings of the 25th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Revised5 report on the algorithmic language scheme
ACM SIGPLAN Notices
The second Futamura projection for type-directed partial evaluation
PEPM '00 Proceedings of the 2000 ACM SIGPLAN workshop on Partial evaluation and semantics-based program manipulation
The Definition of Standard ML
A Semantic Account of Type-Directed Partial Evaluation
PPDP '99 Proceedings of the International Conference PPDP'99 on Principles and Practice of Declarative Programming
A Simple Solution to Type Specialization
ICALP '98 Proceedings of the 25th International Colloquium on Automata, Languages and Programming
Towards a theory of type structure
Programming Symposium, Proceedings Colloque sur la Programmation
The Design of a Pretty-printing Library
Advanced Functional Programming, First International Spring School on Advanced Functional Programming Techniques-Tutorial Text
POPL '84 Proceedings of the 11th ACM SIGACT-SIGPLAN symposium on Principles of programming languages
Journal of Functional Programming
Proceedings of the 2008 ACM SIGPLAN workshop on ML
Journal of Functional Programming
Finally tagless, partially evaluated: Tagless staged interpreters for simpler typed languages
Journal of Functional Programming
Hi-index | 0.00 |
This article presents several general approaches to programming with type-indexed families of values within a Hindley-Milner type system. A type-indexed family of values is a function that maps a family of types to a family of values. The function performs a case analysis on the input types and returns values of possibly different types. Such a case analysis on types seems to be prohibited by the Hindley-Milner type system. Our approaches solve the problem by using type encodings. The compile-time types of the type encodings reflect the types themselves, thereby making the approaches type-safe, in the sense that the underlying type system statically prevents any mismatch between the input type and the function arguments that depend on this type.A type encoding could be either value-dependent, meaning that the type encoding is tied to a specific type-indexed family, or value-independent, meaning that the type encoding can be shared by various type-indexed families. Our first approach is value-dependent: we simply interpret a type as its corresponding value. Our second approach provides value-independent type encodings through embedding and projection functions; they are universal type interpretations, in that they can be used to compute other type interpretations. We also present an alternative approach to value-independent type encodings, using higher-order functors.We demonstrate our techniques through applications such as C printf-like formatting, type-directed partial evaluation, and subtype coercions.