Join Newsletter

Modes of Composition in Functional Scala Programming

YOW! Lambda Jam 2020 - 20 Jul

This workshop is an online workshop that will take place over two days:

  • Monday 20 July: 10am - 12:10pm
  • Tuesday 21 July: 10am - 12:10pm

This workshop teaches strongly typed, effectful functional program design in Scala. We will explore how techniques for composing and decomposing functional programs work in an applied scenario around ecommerce order processing.

Composition is a central value in functional programming; the idea is that we build larger, more complex software by composing smaller, simpler pieces. Making it easy to combine pieces together is a key attribute of good programming methods.

Ben Hutchison

Software Architect

Seek

Australia

Ben Hutchison is a Software Architect at SEEK in Melbourne, where his current focus is on data security.

He has also coordinated the Melbourne Scala user group the past 10 years. Ben maintains and/or contributes to a number of open source Scala projects and is a Typelevel and Scala community committer. His particular engineering interests include strong static typing, Scala in the browser client, and applying functional programming & type-classes in industry.

Workshop Details

Target Audience
developers, Technical leads and Architects,programmers, testers, business analysts and product owners
Level
Intermediate
Duration
Full day

Learning Outcomes

The workshop explores the idea that there are recurring patterns, or modes, of composition that are useful in a broad range of situations. We are going to examine them as concepts and then see how they manifest in a practical example.

- Applicative composition lets us compose independent or parallel work
- Monadic composition lets us compose dependent or sequential work
- Effect composition lets us combine the different "side-effects" of
doing work together
- Stream composition lets us compose repeated work
- Isomorphic composition lets us compose a function and its inverse to
travel between two states
- Layered composition lets us compose domain model layers together in
which different rules and invariants apply

The workshop exercises build an order processing system in a series of structured and guided steps. Each step includes a focussed problem that illustrates compositional concepts, supported by scaffold code. By keeping the code in each incremental step small and providing clear guidance as to how to tackle each problem, participants can extend their skills and succeed in applying best-practice functional techniques.

Technology-wise, we will work with Scala, the Cats/Typelevel library ecosystem, and SBT.

A github repository will be provided with workshop notes and code.

Prerequisites

Participants should have familiarity with Scala syntax. Experience
with applied functional programming is not required or assumed. People
with another typed functional language such as Haskell should also be
able to follow the workshop concepts.