Skip to content
0:00 / 0:00

#freemonads#freeapplicatives#scala

Move Over Free Monads: Make Way for Free Applicatives! — John de Goes

Scala World

5.9K subscribers • 13 videos on Hallway

YouTube
  • Recommended by 2 people: 1 in engineering communities and 1 curated list.
  • Presented by John de Goes

Advanced. Deep dive for people who know the field.

22K views10 years ago2 recommendations

Programming languagesSoftware designFunctional programmingScala

John de Goes explains how free applicatives enable static analysis and transformation of program structure in ways that free monads cannot.

In the Scala FP community, free monads are one of the fastest growing and hottest ways to compose programs from small, modular, interpretable languages. Yet, the trees described by free monads are dynamic: their structure depends on runtime values, which limit the types of analysis one can do on these trees. Free applicatives address this limitation by only permitting trees whose structure can be described statically, independent from runtime values. In this talk, John shows how this tradeoff enables extremely powerful introspection and transformation of the very structure of a program, in ways that are completely impossible with free monads.

Why it's here

2 people recommend this

What people say. Recommended as a great explanation of the trade-offs between free monads and free applicatives.

u/hardwaresoftonin r/haskell • Recommends

Optimizing interpreters for FreeR Monads by using a No-Op Monad & 2 passes? **Background** I've been thinking a lot recently about applications needing to be as state-machine-like as possible, and the necessity/benefits of algebras for expressing (and in effect helping limit) what applications can do. These concepts most directly translate to `Free`/`FreeR` `Monad`/`Applicative` in Haskell. The concept can be achieved with `mtl` + typeclasses as a polymorphic `m` give near identical functionality -- you can constrict what the `m` can do with typeclass-based constraints -- this has very similar benefits (and a bit of an escape hatch) but isn't as cleanly expressed IMO. Recently while readi…

programming-talkscurated list on GitHubRecommends

Under “Scala”

Move Over Free Monads: Make Way for Free Applicatives! 00:45:29 by **John de Goes** (2016)

u/PM_ME_UR_OBSIDIANin r/compsci • Mentions

On “Design Patterns for Humans”

IMHO, OOP design patterns lack a punch compared to functional design patterns. Compare and contrast: - The Actor Model for concurrency; - Higher-order combinators for collections (`.map`, `.fold`, `.choose`, `.collect`, ...) which are the ancestor of LINQ; - ~~Monads~~ Burritos; - Applicatives, used for example in `optparse-applicative`; - Free structures as DSLs, particularly free monads and free applicatives; ...and probably many more which I forget right now. These are effective solutions to some very hard problems in software engineering, mostly relating to separation of concerns and testability.

u/aaron_dsin r/scala • Mentions

On “The Free Monad and its Cost”

We just finished converting an ad hoc collection of elasticsearch/geotrellis/spark rdd code to Free and while the long term results aren't in, the code is orders of magnitude more composable and modular. From what I've read/watched there are some limitations compared to other methods, but I think we'll be able to work around them creatively.

u/Milyardoin r/scala • Mentions

On “Can someone explain to me the benefits of IO?”

Sure, we'll look a few popular ways of doing effects in Scala right now. With the Free Monad you'll see `Coproduct` is used to present a list of possible capabilities(called algebras in this context). The `Inject` typeclass is then used to assert that an effect has all the capabilities in the list. The Freestyle project replaces `Coproduct` with it's own fast tagging system but contains the same idea. There's a coproduct which represents a lists of capabilities. `Inject` proves that certain capabilities are in the effect. With the Eff Monad we'll see the same thing. Similarly to Freestyle, Eff provides it's own coproduct. But instead of listing capabilities, Eff lists other monads. In the…

u/Storiniin r/scala • Mentions

On “Explaining monad (or functional programming, or ScalaZ, etc.) tutorials be like...”

I really liked John de Goes' presentation on Free Applicatives: [video . It might seem that taking things up to the Free level would complicate things further, but I found the conceptual insights presented there very helpful in clearly distinguishing the underlying concepts.