Skip to content
0:00 / 0:00

#foldl#applicative#existentialquantification

MuniHac 2016: Beautiful folds are practical, too

TNG Technology Consulting GmbH

5K subscribers • 17 videos on Hallway

YouTube
  • Recommended by 6 people: 6 in engineering communities.
  • A classic. People kept recommending it from 2017 to 2023.
  • Presented by Gabriel Gonzalez
  • Linked in the descriptionSlides on github.com

Intermediate. Assumes working knowledge.

8.9K views10 years ago6 recommendations

Programming languagesSoftware designHaskellFunctional programmingDesign patterns

Gabriel Gonzalez demonstrates how to build composable, efficient, and parallelizable folds in Haskell using the foldl library.

A keynote talk at MuniHac 2016 given by Gabriel Gonzalez. This talk covers an analytics trick that commonly arises in distributed/parallel programming. Haskell permits an elegant, efficient, and general implementation of this trick which also has useful applications outside of high-performance computing. Slides: see github.com/Gabriel439/slides/blob/master/munihac/foldmap.md See also MuniHac 2016: munihac.de Recorded at TNG Technology Consulting / tngtech.com at 3rd of September 2016 at Unterföhring near Munich

Why it's here

6 people recommend this

What people say. Highly recommended for demonstrating the power of applicative functors and composable folds in Haskell.

Moments people linked to

u/yogsotothin r/haskell • Recommends

On “Haskell Design Patterns?”

I would also add this video to the list: MuniHac 2016: Beautiful folds are practical, too link to this video

u/ephrionin r/haskell • Recommends

On “Best way to parallelise map-reduce”

The talk Beautiful Folds are practical, too covers parallel folds. The speaker (now Gabriella) talks about how the implementation of parallel folds on pure computation ends up being slightly slower since list fusion in GHC is a significant optimization that you don't get with the parallel implementation. Are you interested in parallelism as a *practice* for learning the technique in Haskell? If so, I'd suggest Parallel and Concurrent Programming in Haskell, which should guide you through the parallelism and concurrency tools to do this. Are you interested in making this go *as fast as possible*, and see parallelism as the tool for that? It may not be, depending on exactly how `evalSoluti…
12View on Reddit

u/Tekmoin r/haskell • Recommends

On “Existential Quantification Patterns and Antipatterns”

The existential quantification implementation optimizes better than the recursive implementation. GHC is much better at optimizing non-recursive code than recursive code A related type that requires existential quantification is this one: data Fold a b = forall m . Monoid m => Fold (a -> m) (m -> b) This is the type I presented in this talk: * Beautiful folds are practical, too

u/Platzin r/haskell • Recommends

On “What is your favorite video with Haskell”

[Taming the C monster: Haskell FFI techniques - YOW! Lambda Jam 2018 | Fraiser Tweedale] Type Inference from Scratch - f(by) 2019 | Christoph Hegemann Deriving Via - SkillsCast| Andres Löh Beautiful folds are practical, too - MuniHac 2016 | Gabriel Gonzalez Honorable mention for comedic value: - Haskell in the Newsroom | Erik Hinton

u/fintanhin r/haskell • Recommends

On “Can foldMap do several functions at "one run"?”

Relevant video: [video

u/radicalbitin r/haskell • Recommends

On “"Aha" moments when learning functional programming, when coming from an imperative background?”

This talk about 'Beautiful folds' was mind blowing to me: link to this video It finally clicked into place how powerful applicatives are. You can lift regular plain old functions to create new folds out of old ones just because it has an applicative interface-- amazing!

u/dolotoin r/haskell • Mentions

On “What are the hardest/most interesting, perhaps little known, but useful concepts that you know? I'm trying to broaden my horizons, but it's hard to google for "things I don't understand" so I'd appreciate any help.”

…all recursions schemes. - You can say that the fusion laws^(aka, adjoint fold laws) are based on how those squares compose. - `elgot` Algebras correspond to compositions of `cata; apo`, iirc. King: http://comonad.com/reader/2009/recursion-schemes/ Slides: https://github.com/willtim/recursion-schemes/raw/master/slides-final.pdf Video: link to this video Similarly, the notion of _Promorphisms_, `prepro, postpro`, involve further concepts like _Natural Transformations_ (`f a -> g a`), namely, Natural _Endomorphisms_ (`f a -> f a`). As such they naturally compose verticallyNatComp, while composing promorphisms schemes happens somewhat _horizontally_, in the same context. If you want an…

u/MrFincher_Paulin r/haskell • Mentions

On “Haskell frustration”

you might be interested in this talk "Beautiful folds are practical, too" link to this video

u/ephrionin r/haskell • Mentions

On “Inspiring Code, Talks, Papers, and Writing in Haskell?”

MuniHac 2016: Beautiful folds are practical, too

u/siddhanathanin r/haskell • Mentions

On “What'd be the best way to check if a list is all 1's and 0's, or -1's and 0's?”

Gabriel has a nice talk on beautiful folds: link to this video This goes into a bit more depth on using monoids for folds.