Programming with Categories - Lecture 5

preview_player
Показать описание

Lecturers: Brendan Fong, Bartosz Milewski, David Spivak

Summary: In this course we explain how category theory—a branch of mathematics known for its ability to organize the key abstractions that structure much of the mathematical universe—has become useful for writing elegant and maintainable code. In particular, we'll use examples from the Haskell programming language to motivate category-theoretic constructs, and then explain these constructs from a more abstract and inclusive viewpoint. Hands-on programming exercises will be used to demonstrate categorical ideas like "the universal property of products" in working Haskell code.

We will assume no background knowledge on behalf of the student, starting from scratch on both the programming and mathematics.

(Video: Paolo Perrone.)
Рекомендации по теме
Комментарии
Автор

Around 9:00, I think the confusion of the audience is due to the fact that on the right hand side, the `a` in `MkId a` is really a placeholder for a value of type `a`, while on the left hand side, the `a` in `Identity a` is really a type.

tiziano
Автор

Here is small confusing typo. "typeclass" on the board should be just "class".

DmitryKurilo
Автор

Btw, it may be useful to explain the convention for variable scope - both type variables and terms - in Haskell.
It may also be worth remarking on the reason there is so much reuse - obviously relating to the limitations of the keyboard, which does not make it easy to use that many different glyphs.

bblfish
Автор

I can feel the confusion of students when Bartosz explains ADT definition syntax. It's really weird that term-level things and type-level things are mixed on the right hand side.
Meet `data Identity a = MkId a`
Well, let's see, `Identity a` part is fine, it's just a function along with its argument, cool, that's how functions are defined, i even maybe assume that `Identity :: * -> *`.
But then comes `MkId a` and you are like, wtf, `MkId` is a term and `a` is a type? How do they fit together?
GADT notation is much more straightforward in this sense: `data Identity a where MkId :: a -> Identity a` - yeah, that's fine, we have that `Identity a` function head, then there is some term named `MkId` which has the type `a -> Identity a`, cool.

Upd: right after writting this comment i resumed the video and someone said that GADTs are more straightforward. High five bro

tkjyxrb
Автор

To anybody reading this if your one day talking in front of a public and in front of a camera at the same time PLEASE REPEAT THE PEOPLE QUESTIONS ;-)

Luxcium
Автор

00:05:20 𝖽𝖺𝗍𝖺 𝖨𝖽𝖾𝗇𝗍𝗂𝗍𝗒 𝖺 = 𝖬𝗄𝖨𝖽 𝖺
00:33:18 𝖼𝗅𝖺𝗌𝗌 𝖥𝗎𝗇𝖼𝗍𝗈𝗋 𝖿 𝗐𝗁𝖾𝗋𝖾 𝖿𝗆𝖺𝗉 :: ( 𝖺 -> 𝖻 ) -> ( 𝖿 𝖺 -> 𝖿 𝖻 )
00:35:31 𝗂𝗇𝗌𝗍𝖺𝗇𝖼𝖾 𝖥𝗎𝗇𝖼𝗍𝗈𝗋 𝖨𝖽𝖾𝗇𝗍𝗂𝗍𝗒 𝗐𝗁𝖾𝗋𝖾 𝖿𝗆𝖺𝗉 𝖿( 𝖬𝗄𝖨𝖽 𝖺 ) = 𝖬𝗄𝖨𝖽( 𝖿 𝖺 )

SawmonandNatalie
Автор

At 14:37 string goes to identity string via functor. What is the image of identity string coming from string via functor?

jeffreyhowarth
Автор

17:00 Is this a category of categories? In other words, is String a category as well as an object in Hask (i.e., the category of Haskell types)? Is this why we are calling the morphism from String to Identity String a "functor"?

TolgaYilmaz
Автор

When I look at Haskell I see a very rich programming language. When I look at category theory I see 😴😴😴

michaelkohlhaas
Автор

Get someone to advise on how to do camera setup

petergoodall
Автор

This course is a great one, I appreciate very much the Brendan Fong, Bartosz Milewski, David Spivak. But the styles of the lecturer are very different. Bartosz Milewski has a more intuitive style while Brendan Fong, David Spiva has more an academic one. I think that it would be more coherent to have only the "academic approach in this series".

nicolaswezel
Автор

He didn't make it clear what is Haskell syntax, what is his conceptual explaination. Not helpful for people do not already know Haskell.

jma
Автор

This is lecture 5 and we are still talkig about functors? This is frigging boring!

michaelkohlhaas