# Joinads: a retargetable control-flow construct for reactive, parallel and concurrent programming

Tomas Petricek and Don Syme

In Proceedings of PADL 2011

Modern challenges led to a design of a wide range of programming models for reactive, parallel and concurrent programming, but these are often difficult to encode in general purpose languages. We present an abstract type of computations called joinads together with a syntactic language extension that aims to make it easier to use joinads in modern functional languages.

Our extension generalizes pattern matching to work on abstract computations. It keeps a familiar syntax and semantics of pattern matching making it easy to reason about code, even in a non-standard programming model. We demonstrate our extension using three important programming models – a reactive model based on events; a concurrent model based on join calculus and a parallel model using futures. All three models are implemented as libraries that benefit from our syntactic extension. This makes them easier to use and also opens space for exploring new useful programming models.

## Related papers

This paper presents the original version of joinads in F#. There is also a newer version (implemented in Haskell) that is more theoretically oriented and discusses reasoning about joinads in more details. The main differences are that the updated version requires all joinads to be monads (which is more restrictive) and it is translated in terms of simpler operations. See Extending Monads with Pattern Matching for more information.

 1: 2: 3: 4: 5: 6: 7: 8: @inproceedings{joinads-padl11, author = {Petricek, Tomas and Syme, Don}, title = {Joinads: a retargetable control-flow construct for reactive, parallel and concurrent programming}, booktitle = {Proceedings of Practical Aspects of Declarative Languages}, series = {PADL 2011}, location = {Austin, TX, USA}, }