u/tpolecatTypelevelin r/scala • Recommends
On “What is the FP way to model an object that is unavoidably mutable, like an http connection or something.”
10K subscribers • 19 videos on Hallway
Intermediate. Assumes working knowledge.
9.2K views11 years ago6 recommendations
Programming languagesDatabases and dataScalaFunctional programmingSQL
Rob Norris explains how to treat database programs as values using the Doobie library in Scala.
This talk video is a node in devreal.ai, the developer community graph. It connects to: Talk: Programs as Values: JDBC Programming wit... — devreal.ai/t/150815-programs-as-values-jdbc-programming-wit-… Speaker: Rob Norris — devreal.ai/n/rob-norris Project: Doobie — devreal.ai/p/doobie Event: Scala by the Bay — devreal.ai/e/150814-scala-by-the-bay-conference Explore these connections and related videos, photos, speakers’ blogs and podcasts, and other By the Bay networks. ----- FP is often glibly described as "programming with functions", but we can equivalently say that FP is about programming with *values*. Functions are values, failures are values, effects are values, and indeed programs themselves can be treated as values. This talk explores some consequences of this idea of programs-as-values by looking at *doobie*, a pure-functional database library for Scala. We will examine the low-level implementation via free monads over algebras of the JDBC types, and show how this naturally enables an expressive and safe high-level API with familiar, lightweight, and composable abstractions including streaming result sets, and trivial compatibility with other pure libraries like Remotely and HTTP4s. Even if you are not in the market for a database layer, this talk will provide a practical outline for a general solution to dealing with terrible APIs (like JDBC) in a principled way. 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.What people say. Recommended as an excellent explanation of monads, free monads, and how to design functional DSLs for database access.
u/tpolecatTypelevelin r/scala • Recommends
On “What is the FP way to model an object that is unavoidably mutable, like an http connection or something.”
u/mn-haskell-guyin r/haskell • Recommends
u/chuwy24in r/scala • Recommends
On “How much functional is enough?”
u/Froyoforeverin r/scala • Recommends
On “Building my first DSL. Query language + object manipulation.”
u/paultypesin r/scala • Recommends
On “Modular, immutable, but extensible application architecture?”
u/ResidentAppointment5in r/scala • Recommends
On “Seriously: What is the best explanation of Monads for people who can't grasp it?”
u/tpolecatTypelevelin r/scala • Mentions
On “Can I make my DSL do this with an implicit?”
u/paultypesin r/scala • Mentions
On “In my second blog post I wrote about monads. Hopefully it helps someone. Let me know what you think”
u/laiebcrkabin r/scala • Mentions
On “In Scala what is the exact meaning of the word Algebra.”