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

Опубликовано: 26 Ноябрь 2016
на канале: 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.


Смотрите видео scala.bythebay.io: Rob Norris, Pure Functional Database Programming with Fixpoint Types онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь FunctionalTV 26 Ноябрь 2016, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 2,41 раз и оно понравилось 3 людям.