HackerTube.dev

Edward Kmett - Type Classes vs. the World

Boston Haskell · 35.6K views · 2015-02-16 · 1:42:53

Open on YouTube ↗

If playback is restricted in your region, try opening the original video. Use Mark watched to add it to your marked videos.

Overview

Edward Kmett speaks at the Boston Haskell meetup about type classes and the design tradeoffs of global coherence compared with other approaches to implicit instances. It covers why uniqueness of instances matters for reasoning and refactoring.

On Hacker News

HN points to it as the definitive explanation of why coherence and the orphan rule matter, in debates over Haskell, Rust traits, OCaml modules and Elm.

Recommended by 2 HN people across 2 months · HN mentions 2015–2024

Topics

Search by tags

What people said

shadytrees · 2015-09 · Strong recommendation

The point is a little more subtle than this, or how the article made it out to be. Global coherence and confluence (which GHC attempts to enforce unless told otherwise) is great for refactoring and equational reasoning and (yes) mathematics and programming at large, as Ed Kmett's fantastic "Typeclasses v. the World" talk covers: [VIDEO] Global uniqueness of instances (which GHC does NOT enforce) is bad for modular programming, or programming at large, which is a point some of the commenters here are making. [LINK] The submitted HN link here has a terrible title. What the author is proposing is enforcing typeclass laws, which is a great idea (but difficult in practice to implement). Practice and time has shown that lawless classes are the ones that people hate, the ones that don't add any benefit and in fact make it harder to reason about large Haskell programs. I hope people don't take away from this link that classes in Haskell are bad. Haskell is three things: pure, functional, and typeclasses. They're part of the identity of Haskell; they're the reason we set off on this wonderful journey into the uncharted oceans of functional programming back in 1990. Typeclasses are AWESOME. And they can be improved. Postscript: Kmett also has a package that persuades the compiler to let you have dynamically generates instances. It has the same user experience as local implicits, which I think a lot of people here are asking for: [LINK] λ> using (Monoid (+) 0) $ mappend mempty 12 12 GHC

Read the original HN comment ↗
Twey · 2023-08 · Recommendation

Edward Kmett has a great explanation[1] of the considerations around this space. It's not that alternatives to the orphan rule are hard to implement, it's that they lead to things being much harder to reason about for the programmer. [1]: [VIDEO]

Read the original HN comment ↗
themk · 2024-11 · Reference

It's been a while now, but I believe Ed Kmett covers some of this in his talk "Typeclasses vs The World" [VIDEO]

Read the original HN comment ↗

Sources

Video by Boston Haskell, played through YouTube.

Data and selection notes

HN summaries and labels may contain AI errors. HN dates refer to discussions, not video publication.

HN Library: HackerTube export (2026-10-31) and open-index/hacker-news. Upstream summaries and classifications may contain AI errors.

Views, duration and playback status refresh separately from the published catalog. When an update fails, existing data remains visible.

Selection checks
  • SaaS & AI candidates: Topic keywords do not match
  • Editor-approved picks: Editorial review is required

Rule matches identify candidates. They do not guarantee video quality or financial results.

About the library and its sources