Time | Talk |

8:30am - 9:00am | Registration |

9:00am - 10:15am | **KEYNOTE: A categorical view of computational effects** Dr. Emily Riehl Monads have famously been used to model computational effects, although, curiously, the computer science literature presents them in a form that is scarcely recognizable to a category theorist — I’d say instead that a monad is just a monoid in the category of endofunctors, what’s the problem? ;) To a categorical eye, computational effects are modeled using the Kleisli category of a monad, a perspective which suggests another categorical tool that might be used to reason about computation. The Kleisli category is closely related to another device for categorical universal algebra called a Lawvere theory, which may be a more natural framework to model computation (an idea suggested by Gibbons, Hinze, Hyland, Plotkin, Power and certainly others). This talk will survey monads, Lawvere theories, and the relationships between them and illustrate the advantages and disadvantages of each framework through a variety of examples: lists, exceptions, side effects, input-output, probabilistic non-determinism, and continuations. |

10:30am - 11:15am | **`choose` Your Own Derivative** Jennifer Paykin, Kenneth Foner, Antal Spector-Zabusky In event-driven programming, an event is a computation that will eventually produce a value. Selective choice is a mechanism that takes in a list of events, runs them all concurrently, and returns the value of the first event to terminate. This primitive appears throughout systems and concurrent programming, ranging from Unix system calls (`select` ) to asynchronous programming libraries in Haskell and in OCaml Core. Despite their ubiquity, these primitives are typically restricted to taking a list of events that all produce values of the same type. In this talk, we describe a natural type-directed generalization of selective choice to arbitrary data structures, including those containing events of different types.
The crucial observation we make is that selecting one event out of a data structure is reminiscent of *zipping* into that data structure. Conor McBride defines zippers into arbitrary “regular” algebraic data types by means of a type-level operation that acts like the partial derivative from calculus. We extend this notion of derivative to support data types containing events, and show how to use these derivatives to give a type to our generalization of selective choice. We implement these ideas in Haskell using GHC’s support for dependent types and generic programming, and demonstrate the use of generalized selective choice with a variety of examples. |

11:15am - 11:45am | **Reactive Sheets: an intuitive approach to functional‑reactive computing** Enzo Alda, Monica Figuera, Juan Andrés Escalante, Richard Lares Mejías As the world experiences an exponential growth in the amount of generated real-time data, it is not surprising that reactive computing services, like AWS Lambda, as well as stream processing frameworks, like Apache Storm and Apache Kafka, are becoming increasingly popular. The IT world has been consistently shifting from a request-response paradigm to one of continuous data processing pipelines. Moreover, data rates, volumes, and latency requirements keep getting more stringent, as vendors compete to deliver a better consumer experience.
This talk will first provide some general insights about the theoretical foundations of functional programming, stream processing, and reactive computing. Then, after briefly mentioning some enabling technologies and popular technology stacks, which make possible to build advanced event processing pipelines, the talk will introduce a simple, yet powerful, approach for modeling reactive computations.
The presentation will conclude with a live demonstration of a Web-enabled functional reactive system, showcasing the use of higher order functions to perform real-time calculations and screen rendering transformations over high rate data streams. |

01:00pm - 01:45pm | **Typed-Tagless Final Bioinformatics** Sebastien Mondet At Compose 2015, we quickly mentioned an experiment of a high-level well-typed EDSL to describe complex bioinformatics pipelines. It is a component of the Biokepi library. Its first implementation had grown to be our default API to describe workflows; it was based on a long GADT declaration that would get compiled to our workflow engine’s “lower-level” API. This worked quite well but we hit a couple of fundamental issues: i) the compiler code grew to become difficult to manage (huge “match” statements, and type errors unwelcoming to beginners), ii) more importantly, the EDSL could not be extended by *users* of the library (although there were a few “hooks” to achieve some tasks).
Enter “Typed Tagless Final Interpreters”… In July 2015, Oleg Kiselov introduced the Quel project to the OCaml mailing-list. The idea is to use OCaml’s module system, to provide typed EDSLs as module types and write compilers as modules matching the signature; “programs” and program transformations are then functors taking such an implementation as argument. The approach ensures that the EDSL is extensible.
We reimplemented our EDSL based on this approch, to significant success. The talk will walk through our implementation of Biokepi’s EDSL while trying to be an introductory tutorial on typed-tagless approaches. |

01:45pm - 02:30pm | **The Probability Monad** Tikhon Jelvis Probability distributions form a monad, giving us a lightweight, surprisingly simple probabilistic language embedded in Haskell. We can write stochastic models as normal Haskell programs and then interpret them either exhaustively or by random sampling.
I’ll give an in-depth explanation of how a simple discrete probability distribution monad works, along with real-world examples from my work on supply chain optimization at Target. This simple probability monad has been a great fit for the stochastic optimization problems we’re facing at Target, where different solution methods require random sampling (simulation-based optimization) or the entire distribution (policy iteration, linear programming). As a bonus, this’ll give you a brief primer on supply chain optimization.
I’ll also talk about the very real performance shortcomings of this approach—which we’ve mostly managed to dodge at Target.
Finally, I’ll introduce some recent research that defines a free-monad based distribution type that can take advantage of cutting-edge research on probabilistic programming. This approach lets us work with continuous distributions and Bayesian conditioning, and lets us deploy modern sampling and probabilistic inference algorithms with performance comparable to dedicated probabilistic programming languages like Anglican.
This talk primarily draws on two papers:
- ‘Probabilistic Functional Programming in Haskell’ by Martin Erwig and Steve Kollmansberger which describes the discrete probability monad - ‘Practical Probabilistic Programming with Monads’ by Adam Scibior, Zoubin Ghahramani and Andrew D. Gordon which describes how to extend the basic monadic approach with modern probabilistic programming techniques |

02:30pm - 03:00pm | **Lock-step simulation is child’s play** Joachim Breitner When implementing a multi-player network game, programmers often choose to implement “lock step simulation with client prediction”, where each client independently calculates the global state of the game, and integrate the other player’s actions as soon as he learns about them, rewinding the state to when the action actually happened. This approach to networking is infamously hard to get right and in general requires great discipline from the game programmer to avoid the clients getting out of sync.
Not so with strongly typed pure functional programming
On the programming learning platform CodeWorld, even middle school create multi-player games, without having spend a single thought on these issues, and no matter what code they write, they end up with a working networked game.
In this talk I will explain the interface that CodeWorld provides for this purpose, and show how it pulls this off under the hood. |

03:15pm - 04:00pm | **Learning F#: Case study with branch and bound** David Rhodes We use the branch and bound algorithm as a realistic, non-trivial example of a functional programming challenge. This talk ports the core algoritmfrom imperative style to functional form in F#. This creates some interesting choices and also opens opportunities for parallel processing. Unit and property-based testing is also included. Much of the material is elaborated at: http://www.opcoast.com/demos/fsharp/index.html |

04:00pm - 04:30pm | **QuickFuzz Testing for Fun and Profit** Martín Ceresa, Gustavo Grieco Fuzzing is a technique that involves testing programs using invalid or erroneous inputs. There are two ways of producing invalid inputs: mutational fuzzing involves taking valid inputs and altering them through randomization, producing erroneous or invalid inputs that are fed into the program; generational fuzzing (sometimes also known as grammar-based fuzzing) involves generating invalid inputs from a specification or model of a file format. Unfortunately for generational fuzzing, to write specifications for generational fuzzers is the most expensive part of the process because it requires a deep knowledge of the specific file-format or protocol.
In this talk, we present QuickFuzz, an open source tool for automatically generating inputs and fuzzing programs parsing several common types of files. It is the first fuzzer to use QuickCheck, a highly effective technique developed in the functional programming field to perform automatic testing. Additionally we integrated it with fuzzers like Radamsa, Honggfuzz and other bug-finding tools such as Valgrind and Address Sanitizer to focus our tool for vulnerability discovery.
Our tool relies on existing Haskell implementations of file-format-handling libraries found on Hackage and was effective in discovering issues in real-world implementations of browsers, image processing utilities and file compressors among others. |

04:30pm - 05:00pm | **Working with Monads in OCaml** Stephen Compall As a Haskeller steeped in the adage “ML doesn’t support higher kinds”, learning OCaml, I was surprised to discover that monad-generic programming in OCaml can indeed be done with 100% safety, via modules and functors, and moreover is supported directly by the popular ‘Core’ library.
In this talk, I will show how to define monad instances and write monad-generic functions using the ‘Monad’ modules, and dig into how this works at all. Attendees should get a more concrete feel for the power of the ML module system, as well as a vision of how their Haskell programs might look in ML. |