Reusability and Dependent Types
Robin Milner coined the slogan "well typed programs cannot go wrong", advertising the strength of typed functional languages like ML and Haskell in using types to catch runtime errors. Nowadays, we can and want to go further: dependently typed programming exploits the power of very expressive type systems to deliver stronger guarantees but also additional support for software development, using types to guide the development process. This is witnessed by a recent surge of language proposals with the goal to harness the power of dependent types, e.g. Haskell with GADTs, Agda, Coq, Omega, Concoqtion, Guru, Ynot, Epigram and so on.
However, expressive type systems have their price: more specific types frequently reduce the reusability of code, whose too-specific implementation type may not fit its current application. This phenomenon already shows up in the traditional Hindley-Milner style type system of ML and Haskell; it becomes even more prevalent in a dependently typed setting. Luckily, all is not lost: dependent types are expressive enough that they can talk about themselves reflectively, making meta-programming one of its potential killer applications with the potential of combining expressive types and reusable software components.
Based on and inspired by recent research at Nottingham on dependently typed programming (EPSRC EP/C512022/1) and container types (EPSRC EP/C511964/2) and at Oxford on datatype-generic programming (EPSRC GR/S27078/01, EP/E02128X/1) we plan to explore the potential of dependent types to deliver reusable and reliable software components. To achieve this, we intend to explore two alternative roads—reusability by structure and reusability by design—and express both within a dependently typed framework. Our programme is to build new tools extending the Epigram 2 framework, investigate the underlying theory using container types, and most importantly establish novel programming patterns and libraries.
Selected Publications
-
Programming with Ornaments
Hsiang−Shang Ko and Jeremy Gibbons
In Journal of Functional Programming. Vol. 27. December, 2016.
Details about Programming with Ornaments | BibTeX data for Programming with Ornaments | DOI (10.1017/S0956796816000307) | Download (pdf) of Programming with Ornaments
-
Analysis and synthesis of inductive families
Hsiang−Shang Ko
PhD Thesis University of Oxford. 2014.
Details about Analysis and synthesis of inductive families | BibTeX data for Analysis and synthesis of inductive families | Link to Analysis and synthesis of inductive families
-
Categorical organisation of the ornament–refinement framework
Hsiang−Shang Ko and Jeremy Gibbons
Submitted to POPL'14. July, 2013.
Details about Categorical organisation of the ornament–refinement framework | BibTeX data for Categorical organisation of the ornament–refinement framework | Download (pdf) of Categorical organisation of the ornament–refinement framework