"Categories for the Working Hacker" by Philip Wadler

  Рет қаралды 63,677

Strange Loop Conference

Strange Loop Conference

5 жыл бұрын

The talk will explain why category theory is of interest for developers, taking examples from Java and Haskell, and referencing the new blockchain scripting languages Simplicity, Michelson, and Plutus. The principle of Propositions as Types describes a correspondence between, on the one hand, propositions and proofs in logic, and, on the other, types and programs in computing. And, on the third hand, we have category theory! Assuming only high school maths, the talk will explain how categories model three basic data types: products (logical and), sums (logical or), and functions (logical implication). And it explains why you already learned the most important stuff in high school.
Speaker: Philip Wadler

Пікірлер: 44
@carterthaxton
@carterthaxton 4 жыл бұрын
This guy is amazing. I’ve learned as much about how to give a great presentation as I have about category theory. Thank you!
@bilalf
@bilalf 3 жыл бұрын
> "Object oriented programming" is really well named. You should just object"
@CubOfJudahsLion
@CubOfJudahsLion 2 жыл бұрын
They should make Wadler give *every* computing talk ever.
@ymi_yugy3133
@ymi_yugy3133 4 жыл бұрын
I am really impressed. This is the best introduction to category theory and thinking about known structures in terms of universal properties I've seen yet.
@jamma246
@jamma246 4 жыл бұрын
I didn't know that Philip Wadler gave such entertaining talks, really enjoyed that!
@mikkolukas
@mikkolukas 3 жыл бұрын
28:46 the example is missing a closing '}' just after the return statement.
@bibliusz777
@bibliusz777 2 жыл бұрын
didn't expect this guy to mention Plutus
@cryptonative
@cryptonative Жыл бұрын
“That is what Category Theory is all about- avoiding traffic jam”. It just clicked
@gilbertg.96
@gilbertg.96 5 жыл бұрын
I wish you were my math teacher.
@sendark001
@sendark001 5 жыл бұрын
he was my informatics professor at uni. His was the only 9am lecture that was full in the whole campus :)
@ARVash
@ARVash 5 жыл бұрын
plfa.inf.ed.ac.uk so you don't have to type
@MrGoatflakes
@MrGoatflakes 4 жыл бұрын
dead link ;/
@mskiptr
@mskiptr 3 жыл бұрын
Now a redirection to plfa.github.io/
@a13ph0
@a13ph0 Жыл бұрын
it's alive! alive!
@imode256
@imode256 5 жыл бұрын
So, my question is that if a category corresponds to a proof fragment (logical connective), can I string together proof fragments to get a proof? If so, wouldn't that mean that, in the categorical view of things, computation corresponds to graph reduction because computation corresponds to proof simplification?
@alonzoc537
@alonzoc537 4 жыл бұрын
Yes. That is all... Nah just kidding, if you are interested in this view of computation you should look at citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.90.2386 (An algorithm for optimal lambda calculus reduction). Which shows how lambda calculus can be evaluated using a graph reduction algorithm (And in an optimal way at that. Plus if you built a runtime on this concept you could get multi-threading for free!).
@kernalphage
@kernalphage 4 жыл бұрын
FP is pretty new to me, let me see if I understand this: Products allows you to take 2 types and 'expand' them into a single type? Giving you a type that is all possible combinations of two Enums, for example. While sums lets you "condense" down 2 things (A and B) into 1 (C)? And for some Sums to be useful, (A and/or B) and C should be the same type? So you can do stuff like (ErrorInt => ErrorInt) => ErrorInt or (ErrorInt => Int) => ErrorInt? I know it's tradition to use the same symbols in the diagrams and in the example code, but I think using and [Left, Right] everywhere instead of concrete types is making it really hard to reason about places I'd use these kinds of constructs. Even using something like Alice/Bob/Coworkers might be helpful, and you can go more abstract from there.
@daweiliu6452
@daweiliu6452 5 жыл бұрын
Which text book do people recommend to learn Category theory?
@JohnCook
@JohnCook 5 жыл бұрын
Steve Awodey's book Category Theory is popular.
@Omega0202
@Omega0202 5 жыл бұрын
Category Theory for Programmers is good, it is free, and it has piggies: bartoszmilewski.com/2014/10/28/category-theory-for-programmers-the-preface/
@Yetipfote
@Yetipfote 3 жыл бұрын
"Would you like to see it in Java?" *half the audience packs their suit case*
@ittixen
@ittixen Жыл бұрын
There was an undeniable vocal *noooo* from a significant portion of the audience.
@qwertyman1511
@qwertyman1511 2 жыл бұрын
24:00 why is the case of double false excluded? aka, an Option that is Null, rather than [Result x / None]
@NormanVN
@NormanVN Жыл бұрын
In logic, statements which are false are not 'valid statements'. You can say "2 is even" and it be valid, you can say " '3 is even' is false" (in plainer english: 3 is not even) and be a valid statement. But it's invalid and not a permitted statement to say "3 is even". That statement is not possible to construct from valid statements. So if you have a valid option of String/Integer, it either contains a string or an integer. It's possible to have a type which is either something or null, but that type is an option between something and the null token. It's also valid to have a type that's an int, a string, or null.
@123TeeMee
@123TeeMee 4 жыл бұрын
What does the dotted arrow actually mean?
@alexeykrylov9995
@alexeykrylov9995 4 жыл бұрын
That there exists exactly one such arrow satisfying this diagram (that is, commutativity conditions in the diagram) given non-dotted arrows.
@johnmorrison2645
@johnmorrison2645 Жыл бұрын
Java now has records.
@JixuanLIU
@JixuanLIU 4 жыл бұрын
It's missing in his example of the sum, what to do if the left is an error and the right is an error too?
@markzaidelman
@markzaidelman 3 жыл бұрын
"Right" in his example represents a correct calculation, never an error. You can name the type differently: "Sum a b = Error a | Correct b". Hope that makes it more clear.
@waltermays5551
@waltermays5551 3 жыл бұрын
I assume you are talking about the first and second arguments? In that case, it will match the first pattern (f (Left e) _) and execute that code.
@mattetis
@mattetis 3 жыл бұрын
Doesnt that just mean that you have a sum that represents two different classes of errors? Edit: Something like type GenericError = SegmentationError + AccessError And your function can now switch over the two types summed in the more generic type
@epgui
@epgui 5 ай бұрын
Is the "omega" in "F omega" just another word for a functor? That's what it sounds like, but it wasn't said.
@ee_color
@ee_color 5 жыл бұрын
So we have sum, product and exponential. I wonder what subtraction, division and square root is.
@jonaskoelker
@jonaskoelker 4 жыл бұрын
That's a good question. The two ideas underlying your question are, I think, that (a) the first set of operations (sum, product, exponential) all have inverses; and (b) when we reuse a name (sum etc.) in a new context, it should behave roughly as it did in the old context. For example, when we use the name "+" for string concatenation, we expect it to be associative (it is, e.g. ("hello"+"lovely")+"world" = "hello"+("lovely"+"world")), to have a neutral value that acts like 0 (it has: the empty string, as ""+x equals x for all x) and to have an opposite, string subtraction (it doesn't, really, but maybe the other properties are "the same enough" that "+" is non-confusing). I think in the context of categories, sum and product as defined in this talk are the opposites of each other: if you look at the diagrams (at 10:20 and 20:35), you'll notice that if you reverse the arrows in one diagram it should look like the other diagram. (They have different names including vs. [], but it's the structure that makes diagrams "scary-equals" :D i.e. equivalent for some value of equivalent, which might be category isomorphism but that's beyond my already limited knowledge.)
@milanstevic8424
@milanstevic8424 4 жыл бұрын
I think that would be a logical inverse. I.e. with a sum and product you add something to the table, while subtraction and division, in my mind at least, would have to take something from the table, meaning that the operands should be logically negative. In that sense, the diagrams are the same, but the sets are inverse. So a division of apple and orange would be a pair of something that doesn't have an apple but doesn't have an orange either. I don't know if it's mathematically valid, it's just my intuition. But that would explain why it isn't particularly useful in isolation. Instead of thinking and talking about such a division, it is much more fruitful (pun intended) to talk about the actual product.
@Arbmosal
@Arbmosal 4 жыл бұрын
In general operations don't have inverses. E. G. In the natural numbers we don't have subtraction, in integers no division in rationales no roots
@mattetis
@mattetis 3 жыл бұрын
Wouldnt a "negative" sum type be a sum type with some set of values ommitted instead of added to it? If "-" would be our "type subtraction", "number" the type for natural numbers, and "0" the type that contains only the value 0 We could do something like: type NumberWithout0 = number - 0 To "subtract" 0 from the number type
@Omnifarious0
@Omnifarious0 4 жыл бұрын
A+B seems more like xor, not or.
@ccreutzig
@ccreutzig 4 жыл бұрын
Imagine A and B being sets, and C = {true, false}. Obviously, we call those a true for which f(a) = true etc. What is the set of things in A+B that has (ab) = true? Everything true from A plus everything true from B.
@MindcraftMax
@MindcraftMax 4 жыл бұрын
Well, it really is neither. It is a _disjoint_ union, which means elements of both type A and type B are still counted twice in A+B. So for instance A+A has twice the number of elements in A, whereas A _or_ A equals A, A _xor_ A equals empty type (since TRUE _xor_ TRUE is FALSE and not double TRUE as in the disjoint union).
@J4j4yd3r
@J4j4yd3r 4 жыл бұрын
logical or, not binary or. So yeah, exclusive vs inclusive or.
@anilraghu8687
@anilraghu8687 Жыл бұрын
Curry Howard Correspondence.
"Propositions as Types" by Philip Wadler
42:43
Strange Loop Conference
Рет қаралды 123 М.
"A Little Taste of Dependent Types" by David Christiansen
38:36
Strange Loop Conference
Рет қаралды 37 М.
Which one will take more 😉
00:27
Polar
Рет қаралды 63 МЛН
GADGETS VS HACKS || Random Useful Tools For your child #hacks #gadgets
00:35
Taki Taki Tutorial💃 Where’re you from?🔥
00:14
Diana Belitskay
Рет қаралды 3,9 МЛН
A Sensible Introduction to Category Theory
26:20
Oliver Lugg
Рет қаралды 413 М.
Category Theory for the Working Hacker by Philip Wadler
50:52
Lambda World
Рет қаралды 90 М.
"Why Programming Languages Matter" by Andrew Black
56:39
Strange Loop Conference
Рет қаралды 25 М.
Automated Mathematical Proofs - Computerphile
18:02
Computerphile
Рет қаралды 88 М.
Learning Rust the wrong way - Ólafur Waage - NDC TechTown 2022
51:54
NDC Conferences
Рет қаралды 96 М.
"The Mess We're In" by Joe Armstrong
45:50
Strange Loop Conference
Рет қаралды 375 М.
Category Theory in Life - Eugenia Cheng
40:39
Lambda World
Рет қаралды 98 М.
"From Geometry to Algebra and Back Again: 4000 Years of Papers" by Jack Rusher
31:35
Опасная флешка 🤯
0:22
FATA MORGANA
Рет қаралды 727 М.
Что еще за обходная зарядка?
0:30
Не шарю!
Рет қаралды 431 М.
СЛОМАЛСЯ ПК ЗА 2000$🤬
0:59
Корнеич
Рет қаралды 1,8 МЛН
Теперь это его телефон
0:21
Хорошие Новости
Рет қаралды 138 М.