Proceedings paper

Title:
Types from data: making structured data first-class citizens in F#
Authors:
T. Petříček, G. Guerra, D. Syme
Publication:
Proceedings of the 37th ACM SIGPLAN Conference on Programming Language Design and Implementation
DOI:
Year:
2016
ISBN:
978-1-4503-4261-2

Abstract:
Most modern applications interact with external services and access data in structured formats such as XML, JSON and CSV. Static type systems do not understand such formats, often making data access more cumbersome. Should we give up and leave the messy world of external data to dynamic typing and runtime checks? Of course, not! We present F# Data, a library that integrates external structured data into F#. As most real-world data does not come with an explicit schema, we develop a shape inference algorithm that infers a shape from representative sample documents. We then integrate the inferred shape into the F# type system using type providers. We formalize the process and prove a relative type soundness theorem. Our library significantly reduces the amount of data access code and it provides additional safety guarantees when contrasted with the widely used weakly typed techniques.

BibTeX:
@inproceedings{petricek_types_2016,
    title = {{Types from data: making structured data first-class citizens in F\#}},
    author = {Petricek, Tomas and Guerra, Gustavo and Syme, Don},
    year = {2016},
    booktitle = {{Proceedings of the 37th ACM SIGPLAN Conference on Programming Language Design and Implementation}},
    publisher = {Association for Computing Machinery},
    series = {{PLDI '16}},
    location = {New York, NY, USA},
    doi = {10.1145/2908080.2908115},
    isbn = {978-1-4503-4261-2},
    pages = {477--490},
}