Skip to main content

GATE: Gradual Effect Types

  • Conference paper
  • First Online:
Leveraging Applications of Formal Methods, Verification and Validation (ISoLA 2021)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 13036))

Included in the following conference series:

Abstract

Two recent exciting trends in programming languages are gradual types and algebraic effect handlers. Several steps are required to bring algebraic effect handlers to wider use, one of the most important being the development of a suitable gradual type system.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 59.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 79.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

Institutional subscriptions

References

  • Ahmed, A., Findler, R.B., Siek, J.G., Wadler, P.: Blame for all. In: Principles of Programming Languages (POPL) (2011)

    Google Scholar 

  • Ahmed, A., Jamner, D., Siek, J.G., Wadler, P.: Theorems for free for free: parametricity, with and without types. Proc. ACM Program. Lang. (PACMPL) 1(ICFP), 1–28 (2017)

    Google Scholar 

  • Atkey, R.: Parameterised notions of computation. In: Mathematically Structured Functional Programming (MSFP). BCS (2006)

    Google Scholar 

  • Atkey, R.: Parameterised notions of computation. J. Funct. Program. 19(3–4), 335–376 (2009)

    Article  MathSciNet  MATH  Google Scholar 

  • Bader, J., Aldrich, J., Tanter, É.: Gradual program verification. In: VMCAI 2018. LNCS, vol. 10747, pp. 25–46. Springer, Cham (2018). https://doi.org/10.1007/978-3-319-73721-8_2

    Chapter  MATH  Google Scholar 

  • Schwerter, F.B., Garcia, R., Tanter, É.: A theory of gradual effect systems. In: International Conference on Functional Programming (ICFP), pp. 283–295. ACM (2014)

    Google Scholar 

  • Bauer, A., Pretnar, M.: Programming with algebraic effects and handlers. J. Logical Algebraic Methods Program. 84(1), 108–123 (2015)

    Article  MathSciNet  MATH  Google Scholar 

  • Bierman, G., Abadi, M., Torgersen, M.: Understanding typescript. In: Jones, R. (ed.) ECOOP 2014. LNCS, vol. 8586, pp. 257–281. Springer, Heidelberg (2014). https://doi.org/10.1007/978-3-662-44202-9_11

    Chapter  Google Scholar 

  • Bierman, G., Meijer, E., Torgersen, M.: Adding dynamic types to C\(\sharp \). In: D’Hondt, T. (ed.) ECOOP 2010. LNCS, vol. 6183, pp. 76–100. Springer, Heidelberg (2010). https://doi.org/10.1007/978-3-642-14107-2_5

    Chapter  Google Scholar 

  • Biernacki, D., Piróg, M., Polesiuk, P., Sieczkowski, F.: Binders by day, labels by night: effect instances via lexically scoped handlers. Proc. ACM Program. Lang. (PACMPL) 4(POPL), 48:1–48:29 (2020)

    Google Scholar 

  • Castagna, G., Lanvin, V., Petrucciani, T., Siek, J.G.: Gradual typing: a new perspective. Proc. ACM Program. Lang. (PACMPL) 3(POPL), 16:1–16:32 (2019)

    Google Scholar 

  • Chaudhuri, A., Vekris, P., Goldman, S., Roch, M., Levi, G.: Fast and precise type checking for JavaScript. Proc. ACM Program. Lang. (PACMPL) 1(OOPSLA), 48:1–48:30 (2017)

    Google Scholar 

  • Siek, J., Taha, W.: Gradual typing for objects. In: Ernst, E. (ed.) ECOOP 2007. LNCS, vol. 4609, pp. 2–27. Springer, Heidelberg (2007). https://doi.org/10.1007/978-3-540-73589-2_2

    Chapter  Google Scholar 

  • Convent, L., Lindley, S., McBride, C., McLaughlin, C.: Encapsulating effects in Frank (2018)

    Google Scholar 

  • Courant, N.: Safely typing algebraic effects (2018). http://gallium.inria.fr/blog/safely-typing-algebraic-effects/

  • Cousot, P., Cousot, R.: Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints. In: Principles of Programming Languages (POPL), pp. 238–252 (1977)

    Google Scholar 

  • Dolan, S.: Algebraic Subtyping. BCS, The Chartered Institute for IT (2017)

    Google Scholar 

  • Dolan, S., Mycroft, A.: Polymorphism, subtyping, and type inference in MLsub. In: POPL (2017)

    Google Scholar 

  • Eremondi, J., Tanter, É., Garcia, R.: Approximate normalization for gradual dependent types. Proc. ACM Program. Lang. (PACMPL) 3(ICFP) (2019)

    Google Scholar 

  • Ernst, E., Møller, A., Schwarz, M., Strocco, F.: Message safety in dart. Sci. Comput. Program. 133, 51–73 (2017)

    Article  Google Scholar 

  • Filinski, A.: Representing monads. In: Principles of Programming Languages (POPL), pp. 446–457. ACM (1994)

    Google Scholar 

  • Filinski, A.: Representing layered monads. In: Principles of Programming Languages (POPL), pp. 175–188. ACM (1999)

    Google Scholar 

  • Findler, R.B., Felleisen, M.: Contracts for higher-order functions. In: International Conference on Functional Programming (ICFP), pp. 48–59. ACM, October 2002

    Google Scholar 

  • Flanagan, C.: Hybrid type checking. In: Principles of Programming Languages (POPL), pp. 245–256. ACM, January 2006

    Google Scholar 

  • Forster, Y., Kammar, O., Lindley, S., Pretnar, M.: On the expressive power of user-defined effects: effect handlers, monadic reflection, delimited control. Proc. ACM Program. Lang. (PACMPL) 1(ICFP), 13:1–13:29 (2017)

    Google Scholar 

  • Garcia, R.: Calculating threesomes, with blame. In: International Conference on Functional Programming (ICFP) (2013)

    Google Scholar 

  • Garcia, R., Clark, A.M., Tanter, É.: Abstracting gradual typing. In: Principles of Programming Languages (POPL), pp. 429–442. ACM (2016)

    Google Scholar 

  • Gifford, D.K., Lucassen, J.M.: Integrating functional and imperative programming. In: LISP and Functional Programming, pp. 28–38. ACM (1986)

    Google Scholar 

  • Greenman, B., Felleisen, M.: A spectrum of type soundness and performance. Proc. ACM Program. Lang. (PACMPL) 2(ICFP), 71:1–71:32 (2018)

    Google Scholar 

  • Guha, A., Matthews, J., Findler, R.B., Krishnamurthi, S.: Relationally-parametric polymorphic contracts. In: Dynamic Languages Symposium (DLS), pp. 29–40 (2007)

    Google Scholar 

  • Herman, D., Tomb, A., Flanagan, C.: Space-efficient gradual typing. In: Trends in Functional Programming (TFP) (2007)

    Google Scholar 

  • Hillerström, D., Lindley, S.: Liberating effects with rows and handlers. In: Proceedings of the 1st International Workshop on Type-Driven Development, pp. 15–27. ACM (2016)

    Google Scholar 

  • Hillerström, D., Lindley, S., Atkey, R., Sivaramakrishnan, K.C.: Continuation passing style for effect handlers. In: Formal Structures for Computation and Deduction (FSCD), vol. 84. LIPIcs, pp. 18:1–19. Schloss Dagstuhl (2017)

    Google Scholar 

  • Igarashi, A., Thiemann, P., Vasconcelos, V.T., Wadler, P.: Gradual session types. Proc. ACM Program. Lang. (PACMPL) 1(ICFP), 38 (2017)

    Google Scholar 

  • Kammar, O., Plotkin, G.D.: Algebraic foundations for effect-dependent optimisations. In: Principles of Programming Languages (POPL), pp. 349–360. ACM (2012)

    Google Scholar 

  • Katsumata, S.-Y.: Parametric effect monads and semantics of effect systems. In: Principles of Programming Languages (POPL), pp. 633–646. ACM (2014)

    Google Scholar 

  • King, D.J., Wadler, P.: Combining monads. In: Launchbury, J., Sansom, P. (eds.) Glasgow Workshop on Functional Programming, Workshops in Computing, pp. 134–143. Springer, London (1992). https://doi.org/10.1007/978-1-4471-3215-8_12

  • Leijen, D.: Type directed compilation of row-typed algebraic effects. In: Principles of Programming Languages (POPL), pp. 486–499. ACM, January 2017

    Google Scholar 

  • Liang, S., Hudak, P., Jones, M.P.: Monad transformers and modular interpreters. In: Principles of Programming Languages (POPL), pp. 333–343. ACM (1995)

    Google Scholar 

  • Lindley, S., McBride, C., McLaughlin, C.: Do be do be do. In: Principles of Programming Languages (POPL), pp. 500–514. ACM, January 2017

    Google Scholar 

  • Marino, D., Millstein, T.: A generic type-and-effect system. In: Types in Language Design and Implementation (TLDI), pp. 39–50. ACM (2009)

    Google Scholar 

  • Matthews, J., Findler, R.B.: Operational semantics for multi-language programs. In: Principles of Programming Languages (POPL), pp. 3–10 (2007)

    Google Scholar 

  • McBride, C.: Shonky (2016). https://github.com/pigworker/shonky

  • Milner, R.: A theory of type polymorphism in programming. J. Comput. Syst. Sci. 17(3), 348–375 (1978)

    Article  MathSciNet  MATH  Google Scholar 

  • Mitchell, J.C.: Coercion and type inference. In: Principles of Programming Languages (POPL), pp. 175–185. ACM (1984)

    Google Scholar 

  • Moggi, E.: Computational lambda-calculus and monads. In: Symposium on Logic in Computer Science (LICS), pp. 14–23. IEEE (1989)

    Google Scholar 

  • Moggi, E.: Notions of computation and monads. Inf. Comput. 93(1), 55–92 (1991)

    Article  MathSciNet  MATH  Google Scholar 

  • Garrett Morris, J., McKinna, J.: Abstracting extensible data types: or, rows by any other name. Proc. ACM Program. Lang. (PACMPL) 3(POPL), 12 (2019)

    Google Scholar 

  • New, M.S., Licata, D.R., Ahmed, A.: Gradual type theory. Proc. ACM Program. Lang. (PACMPL) 3(POPL), 15:1–15:31 (2019)

    Google Scholar 

  • New, M.S., Jamner, D., Ahmed, A.: Graduality and parametricity: together again for the first time. Proc. ACM Program. Lang. (PACMPL) 4(POPL), 1–32 (2020)

    Google Scholar 

  • Orchard, D., Wadler, P., Eades III, H.: Unifying graded and parameterised monads. In: Mathematically Structured Functional Programming (MSFP), vol. 317. EPTCS, pp. 18–38 (2020)

    Google Scholar 

  • Orchard, D.A., Petricek, T., Mycroft, A.: The semantic marriage of monads and effects. CoRR, abs/1401.5391 (2014). http://arxiv.org/abs/1401.5391

  • Ou, X., Tan, G., Mandelbaum, Y., Walker, D.: Dynamic typing with dependent types. In: Levy, J.-J., Mayr, E.W., Mitchell, J.C. (eds.) TCS 2004. IIFIP, vol. 155, pp. 437–450. Springer, Boston, MA (2004). https://doi.org/10.1007/1-4020-8141-3_34

    Chapter  Google Scholar 

  • Plotkin, G., Power, J.: Semantics for algebraic operations. Electron. Notes Theoret. Comput. Sci. (ENTCS) 45, 332–345 (2001a)

    Article  MATH  Google Scholar 

  • Plotkin, G., Power, J.: Adequacy for algebraic effects. In: Honsell, F., Miculan, M. (eds.) FoSSaCS 2001. LNCS, vol. 2030, pp. 1–24. Springer, Heidelberg (2001). https://doi.org/10.1007/3-540-45315-6_1

    Chapter  Google Scholar 

  • Plotkin, G., Pretnar, M.: Handlers of algebraic effects. In: Castagna, G. (ed.) ESOP 2009. LNCS, vol. 5502, pp. 80–94. Springer, Heidelberg (2009). https://doi.org/10.1007/978-3-642-00590-9_7

    Chapter  Google Scholar 

  • Plotkin, G., Power, J.: Notions of computation determine monads. In: Nielsen, M., Engberg, U. (eds.) FoSSaCS 2002. LNCS, vol. 2303, pp. 342–356. Springer, Heidelberg (2002). https://doi.org/10.1007/3-540-45931-6_24

    Chapter  MATH  Google Scholar 

  • Plotkin, G.D., Power, J.: Algebraic operations and generic effects. Appl. Categ. Struct. 11(1), 69–94 (2003)

    Article  MathSciNet  MATH  Google Scholar 

  • Plotkin, G.D., Pretnar, M.: A logic for algebraic effects. In: Symposium on Logic in Computer Science (LICS), pp. 118–129. IEEE (2008)

    Google Scholar 

  • Reynolds, J.C.: Types, abstraction and parametric polymorphism. In: IFIP congress, vol. 83 (1983)

    Google Scholar 

  • Schwerter, F.B., Garcia, R., Tanter, É.: Gradual type-and-effect systems. J. Funct. Program. 26 (2016)

    Google Scholar 

  • Siek, J., Thiemann, P., Wadler, P.: Blame and coercion: together again for the first time. In: Programming Language Design and Implementation (PLDI) (2015a)

    Google Scholar 

  • Jeremy G. Siek and Walid Taha. Gradual typing for functional languages. In: Scheme and Functional Programming Workshop (Scheme), pp. 81–92, September 2006

    Google Scholar 

  • Siek, J.G., Wadler, P.: Threesomes, with and without blame. In: Principles of Programming Languages (POPL) (2010)

    Google Scholar 

  • Siek, J.G., Vitousek, M.M., Cimini, M., Boyland, J.T.: Refined criteria for gradual typing. In: Summit on Advances in Programming Languages (SNAPL), vol. 32. LIPIcs, pp. 274–293. Schloss Dagstuhl (2015b)

    Google Scholar 

  • Talpin, J.-P., Jouvelot, P.: The type and effect discipline. Inf. Comput. 111(2), 245–296 (1994)

    Article  MathSciNet  MATH  Google Scholar 

  • Tobin-Hochstadt, S., Felleisen, M.: Interlanguage migration: from scripts to programs. In: Object-Oriented Programming: Systems, Languages, and Applications (OOPSLA), pp. 964–974. ACM (2006)

    Google Scholar 

  • Tobin-Hochstadt, S., Felleisen, M.: The design and implementation of typed scheme. In: Principles of Programming Languages (POPL), pp. 395–406. ACM (2008)

    Google Scholar 

  • Toro, M., Garcia, R., Tanter, É.: Type-driven gradual security with references. ACM Trans. Program. Lang. Syst. 40(4), 1–55 2018

    Google Scholar 

  • Toro, M., Labrada, E., Tanter, É.: Gradual parametricity, revisited. Proc. ACM Program. Lang. (PACMPL) 3(POPL) (2019)

    Google Scholar 

  • Verlaguet, J.: Facebook: analysing PHP statically. In: Workshop on Commercial Uses of Functional Programming (CUFP) (2013)

    Google Scholar 

  • Vitousek, M.M., Swords, C., Siek, J.G.: Big types in little runtime: open-world soundness and collaborative blame for gradual type systems. In: Principles of Programming Languages (POPL), pp. 762–774. ACM (2017)

    Google Scholar 

  • Wadler, P.: Theorems for free! In: Functional Programming Languages and Computer Architecture (FPCA) (1989)

    Google Scholar 

  • Wadler, P.: Comprehending monads. In: LISP and Functional Programming, pp. 61–78. ACM (1990)

    Google Scholar 

  • Wadler, P.: The essence of functional programming. In: Principles of Programming Languages (POPL), pp. 1–14. ACM (1992)

    Google Scholar 

  • Wadler, P.: Monads and composable continuations. LISP Symb. Comput. 7(1), 39–56 (1994)

    Google Scholar 

  • Wadler, P.: The marriage of effects and monads. In: International Conference on Functional Programming (ICFP), pp. 63–74. ACM (1998)

    Google Scholar 

  • Wadler, P.: A complement to blame. In: Summit on Advances in Programming Languages (SNAPL), vol. 32. LIPIcs, pp. 309–320. Schloss Dagstuhl (2015)

    Google Scholar 

  • Wadler, P., Findler, R.B.: Well-typed programs can’t be blamed. In: Castagna, G. (ed.) ESOP 2009. LNCS, vol. 5502, pp. 1–16. Springer, Heidelberg (2009). https://doi.org/10.1007/978-3-642-00590-9_1

    Chapter  Google Scholar 

  • Wadler, P., Thiemann, P.: The marriage of effects and monads. Trans. Comput. Logic (TOCL) 4(1), 1–32 (2003)

    Article  MathSciNet  MATH  Google Scholar 

  • Wand, M.: Type inference for record concatenation and multiple inheritance. In: Symposium on Logic in Computer Science (LICS), pp. 92–97. IEEE (1989)

    Google Scholar 

  • Wand, M.: Type inference for record concatenation and multiple inheritance. Inf. Comput. 93(1), 1–15 (1991)

    Article  MathSciNet  MATH  Google Scholar 

  • Wright, A.K., Felleisen, M.: A syntactic approach to type soundness. Inf. Comput. 115(1), 38–94 (1994)

    Google Scholar 

  • Zalewski, J., Mckinna, J., Garrett Morris, J., Wadler, P.: \(\lambda \)db: blame tracking at higher fidelity. In: Workshop on Gradual Typing (2020)

    Google Scholar 

  • Zhang, Y., Myers, A.C.: Abstraction-safe effect handlers via tunneling. Proc. ACM Program. Lang. (PACMPL) 3(POPL), 5 (2019)

    Google Scholar 

  • Zhang, Y., Salvaneschi, G., Beightol, Q., Liskov, B., Myers, A.C.: Accepting blame for safe tunneled exceptions. In: Programming Language Design and Implementation (PLDI), pp. 281–295. ACM (2016)

    Google Scholar 

Download references

Acknowledgements

Philip Wadler acknowledges support from UK EPSRC programme grant EP/K034413/1 ABCD: A Basis for Concurrency and Distribution.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Philip Wadler .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2021 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Wadler, P. (2021). GATE: Gradual Effect Types. In: Margaria, T., Steffen, B. (eds) Leveraging Applications of Formal Methods, Verification and Validation. ISoLA 2021. Lecture Notes in Computer Science(), vol 13036. Springer, Cham. https://doi.org/10.1007/978-3-030-89159-6_21

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-89159-6_21

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-89158-9

  • Online ISBN: 978-3-030-89159-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics