Dependent type providers

David Raymond Christiansen
2013 Proceedings of the 9th ACM SIGPLAN workshop on Generic programming - WGP '13  
Type providers [16] , pioneered in the F# programming language, are a practical and powerful means of gaining the benefits of a modern static type system when working with data schemas that are defined outside of the programming language, such as relational databases. F# type providers are implemented using a form of compile-time code generation, which requires the compiler to expose an internal API and can undermine type safety. We show that with dependent types it is possible to define a type
more » ... provider mechanism that does not rely on code generation. Using this mechanism, a type provider becomes a kind of generic program that is instantiated for a particular external schema, which can be represented using an ordinary datatype. Because these dependent type providers use the ordinary abstraction mechanisms of the type system, they preserve its safety properties. We evaluate the practicality of this technique and explore future extensions.
doi:10.1145/2502488.2502495 dblp:conf/icfp/Christiansen13 fatcat:dd4v6wvhyffjvcgweubbp6nvli