Skip to content

Instantly share code, notes, and snippets.

@dbousamra
Created May 20, 2015 01:08
Show Gist options
  • Select an option

  • Save dbousamra/b1ff4b999d5c3d34d4a3 to your computer and use it in GitHub Desktop.

Select an option

Save dbousamra/b1ff4b999d5c3d34d4a3 to your computer and use it in GitHub Desktop.

Practical Property-Based Testing:

At first it can be tricky working out how exactly you test your code with properties. The good news is that there are some very obvious and useful patterns that can make writing generators and properties easy by mere-mortals. This talk aims to cover some of those patterns, and in doing so help both people working or struggling with property-based testing, and through that to also motivate the use of property-based testing for those still unfamiliar with the concept.

Pure Consensus in a World Full of Failure:

Distributed consensus protocols are notorious for doing people’s heads in. Machines fail and networks lag, which are unfortunate consequences of entropy. Without loss of generality we can assume that the machines despise us, our only hope is to enchant them with correctness proofs, and that we must somehow convince them that safety and liveness are our primary moral concerns.

This talk introduces a new Haskell implementation of Raft, deconstructed as a menagerie of cooperating abstractions for communication, storage and control. A pure protocol description allows local testing and validation of exactly the code that is run on a production cluster. We pause to consider denotational semantics for, like, 30 seconds (“What does it mean to be a protocol?”) before tumbling into the rabbit-hole of code that deals with machines who can’t even agree on what time of day it is.

All attendees will receive a free monad.

Retcon - Imposing Eventual Consistency on Disparate Data Sources:

This talk is a case study in application development using Haskell.

I’ll describe retcon - a system to detect and propagate changes in data duplicated across multiple business systems. I’ll explain the business requirements which drove the project, the design of the system, and the implementation in Haskell of two versions:

Version 1.0 was complicated, difficult to deploy, and used a number of advanced type system features to quite peculiar effect. Version 2.0 is simpler, more capable, easier to deploy, and doesn’t try to showcase all of the language features. I’ll highlight some of the pitfalls I encountered over the course of the project and ways they could have been avoided.

You should enjoy this talk if you like Haskell, language feature gymnastics, or system development war stories.

Immutable Data Stores For Safety, Flexibility and Profit:

At Atlassian, we’re taking the FP principles seriously to ensure we can deliver major architectural improvements without risk of losing customer data. The last frontier is applying immutability to databases, which, conceptually, we’ve all been brought up to treat as entities that need to be mutable. We are starting to embrace event sourcing - capturing streams of immutable ‘events’ to represent domain models instead of update-in-place. This approach ensures safety, and provides both audit trails by default and flexibility to support practically any schema changes and queries we might require in the future, simply by changing our interpretation of events when we replay them.

In this talk, we will describe in detail what event sourcing is, why we use it, actual examples of our domain models implemented in terms of event sourcing, and how we implemented it in Scala using scalaz-stream on top of standard key value stores (AWS DynamoDB).

Using Relative Monads for Cheap Syntax:

In this talk we will present a technique based on relative monads that allows one to embed generic syntax involving a monad, m, which can then be simply reused for any relative monad, relative to m.

We will walk through a production use of this at Commonwealth Bank (converted to Haskell), which has allowed us to cheaply add error handling to new monads and the theory behind it. Finally, we will compare this approach with monad transformers and monad layers.

Using Relative Monads for Cheap Syntax - WORKSHOP / JAM:

In this workshop we will present a technique based on relative monads that allows one to embed generic syntax involving a monad, m, which can then be simply reused for any relative monad, relative to m. We will:

  • Produce a concrete example of a monad with error handling.
  • Encode the relative monad concept as a type class.
  • Generalise the previous error handling code to work for any relative monad relative to the error type.
  • Convert the previous monad to an instance of a relative monad.
  • Explore working with relative monads and monad transformers.
  • We will run the workshop in both Scala and Haskell.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment