Abstract
Traditional designs for functional languages (such as Haskell or ML) have separate sorts of syntax for terms and types. In contrast, many dependently typed languages use a unified syntax that accounts for both terms and types. Unified syntax has some interesting advantages over separate syntax, including less duplication of concepts, and added expressiveness. However, integrating unrestricted general recursion in calculi with unified syntax is challenging when some level of type-level computation is present, as decidable type-checking is easily lost.
This paper argues that the advantages of unified syntax also apply to traditional functional languages, and there is no need to give up decidable type-checking. We present a dependently typed calculus that uses unified syntax, supports general recursion and has decidable type-checking. The key to retain decidable type-checking is a generalization of iso-recursive types called iso-types. Iso-types replace the conversion rule typically used in dependently typed calculus, and make every computation explicit via cast operators. We study two variants of the calculus that differ on the reduction strategy employed by the cast operators, and give different trade-offs in terms of simplicity and expressiveness.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
References
Adams, R.: Pure type systems with judgemental equality. J. Funct. Program. 16(02), 219–246 (2006)
Altenkirch, T., Danielsson, N.A., Löh, A., Oury, N.: \(\varPi \) \(\varSigma \): dependent types without the sugar. In: Blume, M., Kobayashi, N., Vidal, G. (eds.) Functional and Logic Programming. LNCS, vol. 6009, pp. 40–55. Springer, Heidelberg (2010). doi:10.1007/978-3-642-12251-4_5
Augustsson, L.: Cayenne – a language with dependent types. In: ICFP 1998. pp. 239–250 (1998)
Barendregt, H.: Introduction to generalized type systems. J. Funct. Program. 1(2), 125–154 (1991)
Barendregt, H.: Lambda Calculi with types. Handbook of Logic in Computer Science 2, 117–309 (1992)
Brady, E.: IDRIS–systems programming meets full dependent types. In: PLPV 2011, pp. 43–54 (2011)
Cardelli, L.: A Polymorphic Lambda-Calculus with type: type. Digital Systems Research Center (1986)
Casinghino, C., Sjöberg, V., Weirich, S.: Combining proofs and programs in a dependently typed language. In: POPL 2014, pp. 33–45 (2014)
Coq development team: The coq proof assistant. http://coq.inria.fr/
Coquand, T., Huet, G.: The calculus of constructions. Inf. Comput. 76, 95–120 (1988)
Crary, K., Harper, R., Puri, S.: What is a recursive module?. In: PLDI 1999, pp. 50–63 (1999)
van Doorn, F., Geuvers, H., Wiedijk, F.: Explicit convertibility proofs in pure type systems. In: LFMTP 2013, pp. 25–36 (2013)
Eisenberg, R.A., Vytiniotis, D., Peyton Jones, S., Weirich, S.: Closed type families with overlapping equations. In: POPL 2014 (2014)
Girard, J.Y.: Interprtation fonctionnelle et limination des coupures de l’arithmtique d’ordre suprieur. Ph.D. thesis, Universit Paris VII (1972)
Jones, M.P.: Type classes with functional dependencies. In: Proceedings of the 9th European Symposium on Programming Languages and Systems, March 2000
Jutting, L.: Typing in pure type systems. Inf. Comput. 105(1), 30–41 (1993)
Kimmell, G., Stump, A., Eades III, H.D., Fu, P., Sheard, T., Weirich, S., Casinghino, C., Sjöberg, V., Collins, N., Ahn, K.Y.: Equational reasoning about programs with general recursion and call-by-value semantics. In: PLPV 2012, pp. 15–26 (2012)
Mogensen, T.A.: Theoretical pearls: efficient self-interpretation in Lambda Calculus. J. Funct. Program. 2(3), 345–364 (1992)
Norell, U.: Towards a practical programming language based on dependent type theory. Ph.D. thesis, Chalmers University of Technology (2007)
Peyton Jones, S., Washburn, G., Weirich, S.: Wobbly types: type inference for generalised algebraic data types. Technical report, MS-CIS-05-26, University of Pennsylvania, July 2004
Jones, S.P., Meijer, E.: Henk: a typed intermediate language. In: Types in Compilation Workshop (1997)
Pierce, B.C.: Types and Programming Languages. MIT press, Cambridge (2002)
Sjöberg, V., Casinghino, C., Ahn, K.Y., Collins, N., Eades III, H.D., Fu, P., Kimmell, G., Sheard, T., Stump, A., Weirich, S.: Irrelevance, heterogenous equality, and call-by-value dependent type systems. In: MSFP 2012, pp. 112–162 (2012)
Sjöberg, V., Weirich, S.: Programming up to congruence. In: POPL 2015, pp. 369–382 (2015)
Stump, A., Deters, M., Petcher, A., Schiller, T., Simpson, T.: Verified programming in Guru. In: PLPV 2009, pp. 49–58 (2008)
Sulzmann, M., Chakravarty, M.M.T., Jones, S.P., Donnelly, K.: System F with type equality coercions. In: TLDI 2007, pp. 53–66 (2007)
Swamy, N., Chen, J., Fournet, C., Strub, P.Y., Bhargavan, K., Yang, J.: Secure distributed programming with value-dependent types. In: ICFP 2011, pp. 266–278 (2011)
Weirich, S., Hsu, J., Eisenberg, R.A.: System FC with explicit kind equality. In: ICFP 2013, pp. 275–286 (2013)
Yang, Y., Bi, X., Oliveira, B.C.d.S.: Unified syntax with iso-types. Extended Version (2016). https://bitbucket.org/ypyang/aplas16
Yorgey, B.A., Weirich, S., Cretin, J., Jones, S.P., Vytiniotis, D., Magalhães, J.P.: Giving Haskell a promotion. In: TLDI 2012, pp. 53–66 (2012)
Acknowledgments
We thank the anonymous reviewers for their helpful comments. This work has been sponsored by the Hong Kong Research Grant Council Early Career Scheme project number 27200514.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2016 Springer International Publishing AG
About this paper
Cite this paper
Yang, Y., Bi, X., Oliveira, B.C.d.S. (2016). Unified Syntax with Iso-types. In: Igarashi, A. (eds) Programming Languages and Systems. APLAS 2016. Lecture Notes in Computer Science(), vol 10017. Springer, Cham. https://doi.org/10.1007/978-3-319-47958-3_14
Download citation
DOI: https://doi.org/10.1007/978-3-319-47958-3_14
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-47957-6
Online ISBN: 978-3-319-47958-3
eBook Packages: Computer ScienceComputer Science (R0)