Skip to main content
×
×
Home

Programming with ornaments

  • HSIANG-SHANG KO (a1) and JEREMY GIBBONS (a2)
Abstract

Dependently typed programming advocates the use of various indexed versions of the same shape of data, but the formal relationship amongst these structurally similar datatypes usually needs to be established manually and tediously. Ornaments have been proposed as a formal mechanism to manage the relationships between such datatype variants. In this paper, we conduct a case study under an ornament framework; the case study concerns programming binomial heaps and their operations — including insertion and minimum extraction — by viewing them as lifted versions of binary numbers and numeric operations. We show how current dependently typed programming technology can lead to a clean treatment of the binomial heap constraints when implementing heap operations. We also identify some gaps between the current technology and an ideal dependently typed programming language that we would wish to have for our development.

Copyright
References
Hide All
Bernardy, J.-P. & Moulin, G. (2013) Type theory in color. In Proceedings of International Conference on Functional Programming, Uustalu, Tarmo (ed), ICFP'13. New York, NY, USA: ACM, pp. 6172.
Bove, A. & Dybjer, P. (2009) Dependent types at work. In Language Engineering and Rigorous Software Development, Ana Bove, Luís Soares Barbosa, Alberto Pardo, and Jorge Sousa Pinto (eds), Lecture Notes in Computer Science, vol. 5520. Berlin, Germany: Springer-Verlag, pp. 5799.
Brady, E., McBride, C. & McKinna, J. (2004) Inductive families need not store their indices. In Types for Proofs and Programs, Berardi, Stefano, Coppo, Mario, and Damiani, Ferruccio (eds), Lecture Notes in Computer Science, vol. 3085. Berlin, Germany: Springer-Verlag, pp. 115129.
Chapman, J., Dagand, P.-É., McBride, C. & Morris, P. (2010) The gentle art of levitation. In Proceedings of International Conference on Functional Programming, Stephanie Weirich (ed), ICFP'10. New York, NY, USA: ACM, pp. 3–14.
Cockx, J., Devriese, D. & Piessens, F. (2014) Pattern matching without K. In International Conference on Functional Programming, Chakravarty, Manuel M.T. (ed), ICFP'14. New York, NY, USA: ACM, pp. 257–268.
Czarnecki, K., Foster, J. N., Hu, Z., Lämmel, R., Schürr, A. & Terwilliger, J. F. (2009) Bidirectional transformations: A cross-discipline perspective. In Proceedings of International Conference on Model Transformation, Paige, Richard F. (ed), Lecture Notes in Computer Science, vol. 5563. Berlin, Germany: Springer-Verlag, pp. 260–283.
Dagand, P.-É. & McBride, C. (2013) Elaborating Inductive Definitions. In Journées Francophones des Langages Applicatifs, JFLA'13. Rocquencourt, France: INRIA.
Dagand, P.-É. & McBride, C. (2014) Transporting functions across ornaments. J. Funct. Program. 24 (2–3), 316383.
Devriese, D. & Piessens, F. (2011) On the bright side of type classes: Instance arguments in Agda. In Proceedings of International Conference on Functional Programming, Olivier Danvy (ed), ICFP'11. New York, NY, USA: ACM, pp. 143–155.
Dybjer, P. (1994) Inductive families. Form. Asp. Comput. 6 (4), 440465.
Goguen, H., McBride, C. & McKinna, J. (2006) Eliminating dependent pattern matching. In Algebra, Meaning, and Computation, Futatsugi, Kokichi, Jouannaud, Jean-Pierre, and Meseguer, José, (eds), Lecture Notes in Computer Science, vol. 4060. Berlin, Germany: Springer-Verlag, pp. 521–540.
Ko, H.-S. (2014) Analysis and Synthesis of Inductive Families. DPhil Thesis, University of Oxford.
Ko, H.-S. & Gibbons, J. (2013a) Modularising inductive families. Prog. Informat. 10, 6588.
Ko, H.-S. & Gibbons, J. (2013b) Relational algebraic ornaments. In Dependently Typed Programming, Weirich, Stephanie (ed), DTP'13. New York, NY, USA: ACM, pp. 3748.
Kopylov, A. (2003) Dependent intersection: A new way of defining records in type theory. In Logic in Computer Science, Kolaitis, Phokion G. (ed), LICS'03. Washington, DC, USA: IEEE, pp. 8695.
Martin-Löf, P. (1984) Intuitionistic Type Theory. Bibliopolis, Napoli.
McBride, C. (2011) Ornamental Algebras, Algebraic Ornaments. Unpublished manuscript.
McBride, C. (2014) How to keep your neighbours in order. In Proceedings of International Conference on Functional Programming, Chakravarty, Manuel M.T. (ed), ICFP'14. New York, NY, USA: ACM, pp. 297–309.
McBride, C. & McKinna, J. (2004) The view from the left. J. Funct. Program. 14 (1), 69111.
Norell, U. (2007) Towards a Practical Programming Language Based on Dependent Type Theory. PhD Thesis, Chalmers University of Technology.
Norell, U. (2009) Dependently typed programming in Agda. In Advanced Functional Programming, Koopman, Pieter, Plasmeijer, Rinus, and Swierstra, Doaitse (eds), Lecture Notes in Computer Science, vol. 5832. Berlin, Germany: Springer-Verlag, pp. 230266.
Okasaki, C. (1999) Purely Functional Data Structures. Cambridge University Press.
Sheard, T. & Linger, N. (2007) Programming in Ωmega. In Central European Functional Programming School, Horváth, Zoltán, Plasmeijer, Rinus, Soós, Anna, and Zsók, Viktória (eds), Lecture Notes in Computer Science, vol. 5161. Berlin, Germany: Springer-Verlag, pp. 158227.
Williams, T., Dagand, P.-É. & Rémy, D. (2014) Ornaments in practice. In Workshop on Generic Programming, Magalhäes, José Pedro and Rompf, Tiark (eds), WGP'14. New York, NY, USA: ACM, pp. 1524.
Recommend this journal

Email your librarian or administrator to recommend adding this journal to your organisation's collection.

Journal of Functional Programming
  • ISSN: 0956-7968
  • EISSN: 1469-7653
  • URL: /core/journals/journal-of-functional-programming
Please enter your name
Please enter a valid email address
Who would you like to send this to? *
×
Type Description Title
UNKNOWN
Supplementary materials

Ko and Gibbons supplementary material
Ko and Gibbons supplementary material 1

 Unknown (9 KB)
9 KB

Metrics

Altmetric attention score

Full text views

Total number of HTML views: 0
Total number of PDF views: 0 *
Loading metrics...

Abstract views

Total abstract views: 0 *
Loading metrics...

* Views captured on Cambridge Core between <date>. This data will be updated every 24 hours.

Usage data cannot currently be displayed

Programming with ornaments

  • HSIANG-SHANG KO (a1) and JEREMY GIBBONS (a2)
Submit a response

Discussions

No Discussions have been published for this article.

×

Reply to: Submit a response


Your details


Conflicting interests

Do you have any conflicting interests? *