Modularising inductive families

  • Authors:
  • Hsiang-Shang Ko;Jeremy Gibbons

  • Affiliations:
  • University of Oxford, Oxford, United Kingdom;University of Oxford, Oxford, United Kingdom

  • Venue:
  • Proceedings of the seventh ACM SIGPLAN workshop on Generic programming
  • Year:
  • 2011

Quantified Score

Hi-index 0.00

Visualization

Abstract

Dependently typed programmers are encouraged to use inductive families to integrate constraints with data construction. Different constraints are used in different contexts, leading to different versions of datatypes for the same data structure. Modular implementation of common operations for these structurally similar datatypes has been a longstanding problem. We propose a datatype-generic solution based on McBride's datatype ornaments [11], exploiting an isomorphism whose interpretation borrows ideas from realisability. Relevant properties of the operations are separately proven for each constraint, and after the programmer selects several constraints to impose on a basic datatype and synthesises an inductive family incorporating those constraints, the operations can be routinely upgraded to work with the synthesised inductive family.