Sciweavers

ICFP
2012
ACM

Transporting functions across ornaments

12 years 1 months ago
Transporting functions across ornaments
Programming with dependent types is a blessing and a curse. It is a blessing to be able to bake invariants into the definition of datatypes: we can finally write correct-by-construction software. However, this extreme accuracy is also a curse: a datatype is the combination of a structuring medium together with a special purpose logic. These domain-specific logics hamper any effort of code reuse among similarly structured data. In this paper, we exorcise our datatypes by adapting the notion of ornament to our universe of inductive families. We then show how code reuse can be achieved by ornamenting functions. Using these functional ornaments, we capture the relationship between functions such as the addition of natural numbers and the concatenation of lists. With this knowledge, we demonstrate how the implementation of the former informs the implementation of the latter: the user can ask the definition of addition to be lifted to lists and she will only be asked the details necessa...
Pierre-Évariste Dagand, Conor McBride
Added 29 Sep 2012
Updated 29 Sep 2012
Type Journal
Year 2012
Where ICFP
Authors Pierre-Évariste Dagand, Conor McBride
Comments (0)