Skip to main content

Unified Syntax with Iso-types

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 10017))

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.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Notes

  1. 1.

    https://bitbucket.org/ypyang/aplas16.

References

  1. Adams, R.: Pure type systems with judgemental equality. J. Funct. Program. 16(02), 219–246 (2006)

    Article  MathSciNet  MATH  Google Scholar 

  2. 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

    Chapter  Google Scholar 

  3. Augustsson, L.: Cayenne – a language with dependent types. In: ICFP 1998. pp. 239–250 (1998)

    Google Scholar 

  4. Barendregt, H.: Introduction to generalized type systems. J. Funct. Program. 1(2), 125–154 (1991)

    MathSciNet  MATH  Google Scholar 

  5. Barendregt, H.: Lambda Calculi with types. Handbook of Logic in Computer Science 2, 117–309 (1992)

    MathSciNet  Google Scholar 

  6. Brady, E.: IDRIS–systems programming meets full dependent types. In: PLPV 2011, pp. 43–54 (2011)

    Google Scholar 

  7. Cardelli, L.: A Polymorphic Lambda-Calculus with type: type. Digital Systems Research Center (1986)

    Google Scholar 

  8. Casinghino, C., Sjöberg, V., Weirich, S.: Combining proofs and programs in a dependently typed language. In: POPL 2014, pp. 33–45 (2014)

    Google Scholar 

  9. Coq development team: The coq proof assistant. http://coq.inria.fr/

  10. Coquand, T., Huet, G.: The calculus of constructions. Inf. Comput. 76, 95–120 (1988)

    Article  MathSciNet  MATH  Google Scholar 

  11. Crary, K., Harper, R., Puri, S.: What is a recursive module?. In: PLDI 1999, pp. 50–63 (1999)

    Google Scholar 

  12. van Doorn, F., Geuvers, H., Wiedijk, F.: Explicit convertibility proofs in pure type systems. In: LFMTP 2013, pp. 25–36 (2013)

    Google Scholar 

  13. Eisenberg, R.A., Vytiniotis, D., Peyton Jones, S., Weirich, S.: Closed type families with overlapping equations. In: POPL 2014 (2014)

    Google Scholar 

  14. Girard, J.Y.: Interprtation fonctionnelle et limination des coupures de l’arithmtique d’ordre suprieur. Ph.D. thesis, Universit Paris VII (1972)

    Google Scholar 

  15. Jones, M.P.: Type classes with functional dependencies. In: Proceedings of the 9th European Symposium on Programming Languages and Systems, March 2000

    Google Scholar 

  16. Jutting, L.: Typing in pure type systems. Inf. Comput. 105(1), 30–41 (1993)

    Article  MathSciNet  MATH  Google Scholar 

  17. 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)

    Google Scholar 

  18. Mogensen, T.A.: Theoretical pearls: efficient self-interpretation in Lambda Calculus. J. Funct. Program. 2(3), 345–364 (1992)

    Article  MathSciNet  MATH  Google Scholar 

  19. Norell, U.: Towards a practical programming language based on dependent type theory. Ph.D. thesis, Chalmers University of Technology (2007)

    Google Scholar 

  20. 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

    Google Scholar 

  21. Jones, S.P., Meijer, E.: Henk: a typed intermediate language. In: Types in Compilation Workshop (1997)

    Google Scholar 

  22. Pierce, B.C.: Types and Programming Languages. MIT press, Cambridge (2002)

    MATH  Google Scholar 

  23. 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)

    Google Scholar 

  24. Sjöberg, V., Weirich, S.: Programming up to congruence. In: POPL 2015, pp. 369–382 (2015)

    Google Scholar 

  25. Stump, A., Deters, M., Petcher, A., Schiller, T., Simpson, T.: Verified programming in Guru. In: PLPV 2009, pp. 49–58 (2008)

    Google Scholar 

  26. Sulzmann, M., Chakravarty, M.M.T., Jones, S.P., Donnelly, K.: System F with type equality coercions. In: TLDI 2007, pp. 53–66 (2007)

    Google Scholar 

  27. 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)

    Google Scholar 

  28. Weirich, S., Hsu, J., Eisenberg, R.A.: System FC with explicit kind equality. In: ICFP 2013, pp. 275–286 (2013)

    Google Scholar 

  29. Yang, Y., Bi, X., Oliveira, B.C.d.S.: Unified syntax with iso-types. Extended Version (2016). https://bitbucket.org/ypyang/aplas16

  30. 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)

    Google Scholar 

Download references

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

Authors

Corresponding author

Correspondence to Yanpeng Yang .

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics