Loading…
Scalæ By the Bay has ended
View analytic
Sunday, November 13 • 2:10pm - 2:50pm
Pure Functional Database Programming with Fixpoint Types

Sign up or log in to save this to your schedule and see who's attending!

Recursive structures (file systems, family trees, and so on) abound in programming and are especially easy to express and manipulate in functional languages. But some operations, like decorating a tree with arbitrary values or folding/unfolding in an effectful context end up being tricky. As is often the case, it turns out that there are some very powerful abstractions that emerge from examining such problems in detail.
In this talk I will motivate the use of fixpoint types by showing how Fix and Cofree pop out naturally if you push on recursive data a little bit, and will relate these types to the better-known Free monad. The motivating example is serialization of a tree structure to and from Postgres using doobie, a pure functional database layer for Scala. Along the way we will review covariant and traversable functors, and will use equational reasoning and "follow the types" to manipulate database programs in the same way we work with everyday data.
The takeaway is a more general way of thinking about recursive types and recursive programs with effects, and renewed confidence in the power and ease of pure functional programming. This is an intermediate talk that assumes some familiarity with functional programming in Scala.

Speakers
avatar for Rob Norris

Rob Norris

Irritant, Gemini Observatory
Software Engineer


Sunday November 13, 2016 2:10pm - 2:50pm
Caching

Attendees (49)