Skip to main content Accessibility help
×
Home
Hostname: page-component-55b6f6c457-85hf2 Total loading time: 0.275 Render date: 2021-09-24T19:45:50.359Z Has data issue: true Feature Flags: { "shouldUseShareProductTool": true, "shouldUseHypothesis": true, "isUnsiloEnabled": true, "metricsAbstractViews": false, "figures": true, "newCiteModal": false, "newCitedByModal": true, "newEcommerce": true, "newUsageEvents": true }

Idris, a general-purpose dependently typed programming language: Design and implementation

Published online by Cambridge University Press:  18 October 2013

EDWIN BRADY*
Affiliation:
School of Computer Science, University of St Andrews, St Andrews KY16 9SX, UK (e-mail: ecb10@st-andrews.ac.uk)

Abstract

Many components of a dependently typed programming language are by now well understood, for example, the underlying type theory, type checking, unification and evaluation. How to combine these components into a realistic and usable high-level language is, however, folklore, discovered anew by successive language implementors. In this paper, I describe the implementation of Idris, a new dependently typed functional programming language. Idris is intended to be a general-purpose programming language and as such provides high-level concepts such as implicit syntax, type classes and do notation. I describe the high-level language and the underlying type theory, and present a tactic-based method for elaborating concrete high-level syntax with implicit arguments and type classes into a fully explicit type theory. Furthermore, I show how this method facilitates the implementation of new high-level language constructs.

Type
Articles
Copyright
Copyright © Cambridge University Press 2013 

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

References

Altenkirch, T., Danielsson, N. A., Löh, A. & Oury, N. (2010) Dependent types without the sugar. In Tenth International Symposium on Functional and Logic Programming (FLOPS 2010), Blume, M., Kobayashi, N. & Vidal, G. (eds), Lecture Notes in Computer Science 6009. Berlin, Germany: Springer, pp. 4055.CrossRefGoogle Scholar
Asperti, A., Ricciotti, W., Coen, C. S. & Tassi, E. (2011) The Matita Interactive theorem prover. In Automated Deduction – CADE-23, Lecture Notes in Computer Science, 6803. Berlin, Germany: Springer, pp. 6469.CrossRefGoogle Scholar
Asperti, A., Ricciotti, W., Coen, C. S. & Tassi, E. (2012) A bi-directional refinement algorithm for the calculus of (co)inductive constructions. Logical Methods Comput. Sci. 8, 149.CrossRefGoogle Scholar
Augustsson, L. (1985) Compiling pattern matching. In Functional Programming Languages and Computer Architecture, Jouannaud, J.-P. (ed), Lecture Notes in Computer Science, vol. 201. Berlin, Germany: Springer, pp. 368381.CrossRefGoogle Scholar
Bertot, Y. & Castéran, P. (2004) Interactive Theorem Proving and Program Development: Coq'Art: the Calculus of Inductive Constructions. Berlin, Germany: Springer.CrossRefGoogle Scholar
Brady, E. (2005) Practical Implementation of a Dependently Typed Functional Programming Language, PhD thesis, University of Durham, Durham, NC.Google Scholar
Brady, E. (2006, September) Ivor, a proof engine. In Implementation and Application of Functional Languages (IFL'06), Budapest, Hungary, pp. 145162.Google Scholar
Brady, E. (2011a) Epic – A library for generating compilers. In Proceedings of the International Symposium on Trends in Functional Programming (TFP11), Madrid, Spain.Google Scholar
Brady, E. (2011b) Idris – Systems programming meets full dependent types. In Proceedings of the 5th ACM Workshop on Programming Languages Meets Program Verification (PLPV '11). New York, NY: ACM Press.Google Scholar
Brady, E. (2013). Programming in Idris : A Tutorial. Available at http://www.idris-lang.org/documentation/.Google Scholar
Brady, E., McBride, C. & McKinna, J. (2003) Inductive families need not store their indices. In Types for Proofs and Programs (TYPES 2003), Torino, Italy. Berlin, Germany: Springer.Google Scholar
Chapman, J., Altenkirch, T. & McBride, C. (2005). Epigram reloaded: A standalone typechecker for ETT. In Sixth Symposium on Trends in Functional Programming, Tallinn, Estonia.Google Scholar
Chapman, J., Dagand, P.-E., McBride, C. & Morris, P. (2010, September) The gentle art of levitation. In Proceedings of 15th ACM SIGPLAN International Conference on Functional Programming (ICFP '10), Baltimore, MD, vol. 45.Google Scholar
Coquand, T. (1986) An analysis of Girard's paradox. In Proceedings of the First IEEE Symposium on Logic in Computer Science ( LICS'86). Washington, DC: IEEE Comp. Soc. Press, pp. 227246.Google Scholar
Delahaye, D. (2000) A tactic language for the system Coq. In Logic for Programming and Automated Reasoning (LPAR). New York, NY: Springer, pp. 8595.CrossRefGoogle Scholar
Dybjer, P. (1994) Inductive families. Form. Asp. Comput. 6 (4), 440465.CrossRefGoogle Scholar
Hancock, P. & Setzer, A. (2000, August) Interactive programs in dependent type theory. In Proceedings of the 14th Annual Conference of the EACSL on Computer Science Logic, Oxford, UK, pp. 317331.CrossRefGoogle Scholar
Huet, G. (1997) The zipper. J. Funct. Program. 7 (5), 549554.CrossRefGoogle Scholar
Kimmell, G., Stump, A., Eades, H. D. III, Fu, P., Sheard, T., Weirich, S., Casinghino, C., Sjöberg, V., Collins, N. & Ahn, K. Y. (2012) Equational reasoning about programs with general recursion and call-by-value semantics. In Proceedings of the 6th ACM workshop on Programming Languages Meets Program Verification (PLPV '12), Philadelphia, PA.Google Scholar
Lee, C. S., Jones, N. D. & Ben-Amram, A. M. (2001) The size-change principle for program termination. ACM SIGPLAN Not. 36 (3), 8192.CrossRefGoogle Scholar
Löh, A., McBride, C. & Swierstra, W. (2010) A tutorial implementation of a dependently typed lambda calculus. Fundamenta Informaticae 102(2), 177207.Google Scholar
Luo, Z. (1994) Computation and Reasoning: A Type Theory for Computer Science. Oxford, UK: Oxford University Press.Google Scholar
McBride, C. (1999) Dependently Typed Functional Programs and their Proofs, PhD thesis, University of Edinburgh, Edinburgh, UK.Google Scholar
McBride, C. (2000) Elimination with a motive. In Types for Proofs and Programs (TYPES 2000), Durham, UK.Google Scholar
McBride, C., Goguen, H. & McKinna, J. (2006). A few constructions on constructors. In Types for Proofs and Programs (TYPES 2006), Nottingham, UK.Google Scholar
McBride, C. & McKinna, J. (2004) The view from the left. J. Funct. Program. 14 (1), 69111.CrossRefGoogle Scholar
McBride, C. & Paterson, R. (2008) Applicative programming with effects. J. Funct. Program. 18 (1), 113.CrossRefGoogle Scholar
Miller, D. (1992). Unification under a mixed prefix. J. Symb. Comput. 14, 321358.CrossRefGoogle Scholar
Norell, U. (2007). Towards a Practical Programming Language Based on Dependent Type Theory, PhD thesis, Chalmers University of Technology, Sweden.Google Scholar
Peyton Jones, S., Vytiniotis, D., Weirich, S. & Washburn, G. (2006) Simple unification-based type inference for GADTs. In International Conference on Functional Programming (ICFP '06), vol. 41. New York, NY: ACM, pp. 5061.Google Scholar
Pollack, R. (1990). Implicit syntax. In Informal Proceedings of First Workshop on Logical Frameworks, Antibes. Citeseer.Google Scholar
Sozeau, M. & Oury, N. (2008) First-class type classes. In Theorem Proving in Higher Order Logics (TPHOLs 2008), Montreal, Canada, pp. 278293.CrossRefGoogle Scholar
Vytiniotis, D., Peyton Jones, S., Schrijvers, T. & Sulzmann, M. (2011) OutsideIn(X) modular type inference with local assumptions. J. Funct. Program. 21 (4–5), 333412.CrossRefGoogle Scholar
Submit a response

Discussions

No Discussions have been published for this article.
139
Cited by

Send article to Kindle

To send this article to your Kindle, first ensure no-reply@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about sending to your Kindle. Find out more about sending to your Kindle.

Note you can select to send to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be sent to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

Idris, a general-purpose dependently typed programming language: Design and implementation
Available formats
×

Send article to Dropbox

To send this article to your Dropbox account, please select one or more formats and confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your <service> account. Find out more about sending content to Dropbox.

Idris, a general-purpose dependently typed programming language: Design and implementation
Available formats
×

Send article to Google Drive

To send this article to your Google Drive account, please select one or more formats and confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your <service> account. Find out more about sending content to Google Drive.

Idris, a general-purpose dependently typed programming language: Design and implementation
Available formats
×
×

Reply to: Submit a response

Please enter your response.

Your details

Please enter a valid email address.

Conflicting interests

Do you have any conflicting interests? *