HackerTube
HomeLongsLikedHistoryWatch laterCategoriesPlaylistsSettings

Edward Kmett - Type Classes vs. the World

Boston Haskell2 HN recommenders · recommended in 2 months, 2015-2024
YouTube
36K views · 11 years ago · talk · evergreen

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.

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.

Programming language designFunctional programming#haskell#typeclasses#coherence#orphanrule#edwardkmett#traits

6 comments from Hacker News

@themk2024 · in “Traits are a local maximum”

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

CitesView on HN
@Twey2023 · in “This isn’t the way to speed up Rust compile times”

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]: ▶ this video

RecommendsView on HN
@airless_bar2016 · in “An OCaml manifesto – Problems and what's needed for widespread adoption”

> [1] ▶ this video Now we just need a Haskell compiler which actually bothers to provide the "pretty essential for sanity" for global uniqueness. Currently, I count zero compilers in common use which do.

CitesView on HN
@lomnakkus2016 · in “An OCaml manifesto – Problems and what's needed for widespread adoption”

AFAIUI modular implicits don't give you global uniqueness. While this can be "worked around" in some cases[0], it's not really possible in the general case, and global uniqueness is pretty essential for sanity when writing higher-level code[1]. [0] The paper gives set-union as an example. [1] ▶ this video . (Sorry for throwing video at you -- there's probably a write-up somewhere, but I'm in a bit of a rush, and this was the thing that came to mind.)

CitesView on HN
@ablesearcher2015 · in “Making Elm faster and friendlier in 0.16”

I've seen Evan's talk. Evan confuses the presentation of features with the value of those features. (I suppose one could solve the difficulties people have in learning Mathematics by throwing out everything after Algebra I; another solution, however, might be to do a better job teaching the more difficult stuff.) Just because you shouldn't expose new programmers to advanced concepts on the first day doesn't mean they shouldn't be a part of the language. Similarly, the fact (<~) might confuse someone new to Elm isn't a reason for removing it from the language. I'm sympathetic to the concern that some code is too "clever" or dense; but Elm swings the pendulum too far. (Btw, type-classes are not incidental complexity: link ▶ this video )

CitesView on HN
@shadytrees2015 · in “Haskell's Type Classes: We Can Do Better”

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: ▶ this 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

Strongly recommendsView on HN
Lenses, Folds, and Traversals1:54:46

Lenses, Folds, and Traversals

Edward Kmett
54K views • 13 years ago
Philip Wadler  - Propositions as Types (Lambda Days 2016)56:58

Philip Wadler - Propositions as Types (Lambda Days 2016)

Erlang Solutions
20K views • 10 years ago
Simon Peyton-Jones: Escape from the ivory tower: the Haskell journey1:04:16

Simon Peyton-Jones: Escape from the ivory tower: the Haskell journey

Churchill College, University of Cambridge
170K views • 9 years ago
Domain Modeling Made Functional - Scott Wlaschin - KanDDDinsky 201950:49

Domain Modeling Made Functional - Scott Wlaschin - KanDDDinsky 2019

KanDDDinsky
74K views • 6 years ago
Type-Driven Development in Idris — Edwin Brady46:36

Type-Driven Development in Idris — Edwin Brady

Scala World
26K views • 11 years ago
Adventure with Types in Haskell - Simon Peyton Jones (Lecture 1)1:33:37

Adventure with Types in Haskell - Simon Peyton Jones (Lecture 1)

jasonofthel33t
69K views • 12 years ago
On the Expressive Power of Programming Languages by Shriram Krishnamurthi [PWLConf 2019]59:04

On the Expressive Power of Programming Languages by Shriram Krishnamurthi [PWLConf 2019]

PapersWeLove
27K views • 7 years ago
"A Little Taste of Dependent Types" by David Christiansen38:36

"A Little Taste of Dependent Types" by David Christiansen

Strange Loop Conference
48K views • 8 years ago
Invited Talk - Guy Steele1:07:22

Invited Talk - Guy Steele

ClojureTV
39K views • 9 years ago
Effective Programs - 10 Years of Clojure - Rich Hickey1:14:52

Effective Programs - 10 Years of Clojure - Rich Hickey

ClojureTV
176K views • 9 years ago
Succinct Data Structures1:26:11

Succinct Data Structures

Edward Kmett
9K views • 13 years ago
Breaking Down Programming Paradigms: APL's Surprising Learning Curve // Aaron Hsu // Dyalog '1759:03

Breaking Down Programming Paradigms: APL's Surprising Learning Curve // Aaron Hsu // Dyalog '17

Dyalog User Meetings
7K views • 9 years ago
Edwin Brady - Idris 2: Type-driven development of Idris | Code Mesh LDN 1843:23

Edwin Brady - Idris 2: Type-driven development of Idris | Code Mesh LDN 18

Code Sync
20K views • 7 years ago
"Propositions as Types" by Philip Wadler42:43

"Propositions as Types" by Philip Wadler

Strange Loop Conference
143K views • 11 years ago
The Algebra of Algebraic Data Types1:04:35

The Algebra of Algebraic Data Types

London Haskell
27K views • 13 years ago
The Next Five Years of ClojureScript - David Nolen1:00:58

The Next Five Years of ClojureScript - David Nolen

Metosin
19K views • 10 years ago
Simon Peyton Jones - Haskell is useless6:23

Simon Peyton Jones - Haskell is useless

bunidanoable
385K views • 14 years ago
Effective ML1:09:24

Effective ML

Jane Street
30K views • 10 years ago
Simon Peyton Jones - Linear Haskell: practical linearity in a higher-order polymorphic language1:03:34

Simon Peyton Jones - Linear Haskell: practical linearity in a higher-order polymorphic language

Curry On!
19K views • 8 years ago
Stephen Wolfram's Introduction to the Wolfram Language12:56

Stephen Wolfram's Introduction to the Wolfram Language

Wolfram
924K views • 12 years ago