Modes of Composition in Functional Scala Programming
YOW! Lambda Jam 2021 - 03 MayRegister Now
This workshop is an online workshop that will take place over two days:
- Monday 3 May: 10am - 12:10pm (AEST)
- Tuesday 4 May: 10am - 12:10pm (AEST)
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.
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.
The workshop has been updated to Cats Effect v3 and Functional Streams v3, major new releases in Mar 2021
A github repository will be provided with workshop notes and code.
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.
- Target Audience
- Developers, Technical leads and Architects,programmers, testers, business analysts and product owners
- Full day
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.