Typing coroutines

  • Authors:
  • Konrad Anton;Peter Thiemann

  • Affiliations:
  • Institut für Informatik, Universität Freiburg, Germany;Institut für Informatik, Universität Freiburg, Germany

  • Venue:
  • TFP'10 Proceedings of the 11th international conference on Trends in functional programming
  • Year:
  • 2010

Quantified Score

Hi-index 0.00

Visualization

Abstract

A coroutine is a programming construct between function and thread. It behaves like a function that can suspend itself arbitrarily often to yield intermediate results and to get new inputs before returning a result. This facility makes coroutines suitable for implementing generator abstractions. Languages that support coroutines are often untyped or they use trivial types for coroutines. This work supplies the first type system with dedicated support for coroutines. The type system is based on the simply-typed lambda calculus extended with effects that describe control transfers between coroutines.