Chapter

Category Theory and Computer Science

Volume 1290 of the series Lecture Notes in Computer Science pp 261-280

Date:

A calculus for collections and aggregates

  • Kazem LellahiAffiliated withLIPN, URA 1507 du CNRS, Université de Paris 13, Institut Galilée
  • , Val TannenAffiliated withCIS Department, University of Pennsylvania

* Final gross prices may vary according to local VAT.

Get Access

Abstract

We present a calculus that should play for database query languages the same role that the lambda calculus plays for functional programming. For the semantic foundations of the calculus we introduce a new concept: monads enriched with algebraic structure. We model collection types through enriched monads and aggregate operations through enriched monad algebras. The calculus derives program equivalences that underlie a good number of the optimizations used in query languages.