Array programming with monads and comonads

Dominic Orchard

Computer Laboratory
University of Cambridge

Thursday, 2 June 2011, 16:00 (note the unusual time)
Cybernetica Bldg (Akadeemia tee 21), room B101

Slides from the talk [pdf]

Abstract: The category theory structures of monads, and their dual comonads, can be used as abstraction mechanisms for considerably simplifying both language semantics and programs. Whilst monads can be used to structure impure computations, such as state, non-determinism, and partiality, comonads can be used to structure contextual computations, such as dataflow, array computations, and game semantics. There are some computations that are best structured by using a monad combined with a comonad, where a distributive law between a comonad and monad describes their interaction. In this talk we introduce the array comonad, and show that, combined with various monads, we can structure partial arrays, effectul/imperative arrays, and array reductions. Furthermore, we introduce the notion of biKleisli extension which provides a useful framework for programming with monads and comonads.

Tarmo Uustalu
Last update 6.6.2011