scala.bythebay.io: Rob Norris, Pure Functional Database Programming with Fixpoint Types

Published: 26 November 2016
on channel: FunctionalTV
2,414
32

Scale By the Bay 2019 is held on November 13-15 in sunny Oakland, California, on the shores of Lake Merritt: https://scale.bythebay.io. Join us!
-----

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.


Rob Norris
Irritant, Gemini Observatory
By day Rob writes software for big telescopes, and by night he hacks on open-source FP libraries, mostly in Scala. He is a regular irritant on IRC and Twitter where he goes by the handle tpolecat. Rob lives in Portland with his wife, daughter, and cat, all of whom are very good sports.


Watch video scala.bythebay.io: Rob Norris, Pure Functional Database Programming with Fixpoint Types online without registration, duration hours minute second in high quality. This video was added by user FunctionalTV 26 November 2016, don't forget to share it with your friends and acquaintances, it has been viewed on our site 2,41 once and liked it 3 people.