I started learning programming in the imperative style with Python and Javascript. After learning Rust and then recently basic Haskell, my mind was opened to how functions are all you need (according to lambda calculus). But what I also took from Rust and Haskell is that algebraic data types are all you need: just like using "and" and "or" allows you to state so many combinations of phrases in English, product and sum types cover so much of the spectrum. But functions are like implications in English: "if I have A then I have B". They're like pseudo-values where they will have a definite value but only when applied with the required argument. That allows you to work backwards by parameterizing the multiple variants (aka "or" sums) in your output type according to various "or" sum variants in the input domain. So defunctionalization is expressing the sum variation as values rather than function pseudo-values. And that means you can serialize them for storage and transfer compared to true functions. It probably also is important for designing compatibility layers because a C function and Ruby function may not be the same but if they can be serialized to equivalent sum types, then they should be compatible.
@EvanMildenberger23 күн бұрын
10:00 This all makes me think about tensors and the ability to talk about covariance and contravariance at the same time explicitly: for example, a vector is a (1,0)-tensor, a covector/linear form is a (0,1)-tensor, a linear vector space map is a (1,1)-tensor, etc. It seems that (co-)functors are either fully covariant or contravariant but never mixed. What would be a category theory / type theory / functional programming equivalent of a mixed tensor which could have some number of covariant and contravariant pieces? Edit: It seems he explained something like a (1,1)-tensor from abstract algebra as a Profunctor in that it takes 1 contravariant input type and gives 1 covariant output type. But I'm wondering about the terminology that generalizes (p,q) tensors so that you could talk about something that takes 42 contra- input types and gives 314 covariant output types.
@tomchengxiangАй бұрын
Really a good idea, wonder few people watch
@SkellatinaSkellington2 ай бұрын
I have enjoyed going back to look at some of these concepts. Thank you for your presentation. Being a low vision individual, SEEING what you are speaking of is almost impossible unless it is on a black or dark blue background. Fortunately, you were very clear in speaking about what appeared on the screen. Thank you. Please consider us "low vision folk" in the future? <3 💘
@SkellatinaSkellington2 ай бұрын
* For context, I peruse these videos on my lunch breaks. 🙂 ;-)
@Lircking6 ай бұрын
nice
@Lircking6 ай бұрын
amazing
@GuyDude-hk8uy8 ай бұрын
Don't quote me on this, but regarding the "open vs. closed" tradeoff, I think the issue relates closely to the expression problem - therefore, we could use a solution to that in order to recover the openness. Again, don't quote me, but I think this could be achieved (in Haskell, at least) using a typeclass with an associated data type. That way you can create instances of the class "SerializableFn" where you must provide a Data type for each instance and a mapping function to/from said data type cases to the appropriate function/s relevant to that instance. That way - whilst you still need to update the code to handle the new case of course - any old code that just uses the typeclass will have the changes propagated automatically; the same way the definition of (+) itself doesn't need to be modified for each new instance of Num a. Not sure whether this would be able to work out with the kinds, or regarding (multiple) type variables, but it seems somewhat promising. I have a feeling the Haskell MemoTrie library and associated paper "Memo Functions, Polytypically!" may bear some relation.
@dooZyz10 ай бұрын
Great speaker and great talk!
@kahnfatman Жыл бұрын
Is Maybe a special case of Either Nothing?
@DougBeardsley Жыл бұрын
Maybe is equivalent to Either ()
@mathandemotion Жыл бұрын
For everyone who is suffering because of the audio: Easyeffects with noise reduction and autogain makes it sound pretty ok :)
@dengan699 Жыл бұрын
wow good talk!
@a0um Жыл бұрын
Please, ask some help from an audio technician!
@dustin20541 Жыл бұрын
Great video. Please keep making more of them George.
@vpryt182 жыл бұрын
Donya? or Sonya? Is that a typo too?
@djgreyjoy14952 жыл бұрын
I finally understood monads. Thanks Dr Riehl!
@lucasa87102 жыл бұрын
good
@asitisj2 жыл бұрын
Nat <: nat , so how influenced is this from Russell's type theory? Also you can't derive subsumption rule when row type instantiated Jury is still out on, if 0 is nat
@pushinweight2 жыл бұрын
KDA will be legendary.. amazing technology
@Voltra_2 жыл бұрын
9:04 you can in C++ :3
@Evan490BC2 жыл бұрын
Yes, using SFINAE, but it is a low-level hack, as C++ doesn't really have formal interfaces.
@sohangchopra64782 жыл бұрын
Ptghci is also quite good for a terminal REPL
@TheRealSTR2 жыл бұрын
Here we go boys
@craia252 жыл бұрын
this is a crazy way to produce music.... i am wondering how this sounds? ;-)
@jsmdnq2 жыл бұрын
Can this analyze the program Ken Griffin uses to manipulate the fraud market?
@asandax62 жыл бұрын
"Lock-step simulation is child's play" Me: This must be the reason I can't do it because I'm not a child anymore 😥
@dinoscheidt2 жыл бұрын
Even in 2022 great talk. Well done
@English11082 жыл бұрын
I just want to say this technique is obnoxious. Pretty much the whole point of the this technique would be to apply it to the task of iteratively walking through a tree structure and accumulating a value from it. When this gets brought up on the internet, its always (like this video) walking through a tree structure and NOT accumulating a value or, like other articles, accumulating a value from a sequence structure (like summing a list). Table stakes for this technique to be useful is walking a tree AND accumulating a value - but once you do that, the method shown here just doesn't work - why? because you have 2 different conceptual stacks to maintain (one to maintain position in the tree and one to accumulate the value) and the inlining no longer works the same way and there is just nothing out there that bridges the gap.
@1210divs2 жыл бұрын
Correct! Talk is kind of misleading. The reason why the tree traversal function prints the traversal path instead of returning it as a list is because it CAN'T accumulate the path and return it.
@williamd48662 жыл бұрын
@@1210divs That's not true! As TJ above mentions, you can accumulate a value like a list through a tree using this technique. The things you end up accumulating together are just represented by functions arguments for the continuation.
@1210divs2 жыл бұрын
@@williamd4866 I will believe you if you show me a version of the code from this video that returns the output as a sequence rather than printing it.
@williamd48662 жыл бұрын
@@1210divs Something like this would accumulate a list in CPS: List listTree(Tree tree, Function kont) { if (tree != null) { return listTree(tree.left, (L) -> { return listTree(tree.right, (R) -> { return kont(L + [tree.content] + R); }); }); } else { return kont(List()); } }
@1210divs2 жыл бұрын
@@williamd4866 at this point, you are no longer using the continuation and doing plain old recursion that will lead to stackoverflow.
@dean29512 жыл бұрын
12:41 프로세스
@michaelmroz74332 жыл бұрын
I watched this talk for the first time around when it was delivered, when I was first properly getting into FP. Even given that, I've watched it at least three times in the past three months. It's just so fun.
@spiraeth2 жыл бұрын
Bret Victor reference detected.
@chickengoatfish2 жыл бұрын
\m/..\m/
@juliannevillecorrea2 жыл бұрын
thank you sir ❤️
@parietal1002 жыл бұрын
Wonderful presentation. Thank you.
@kaqqao2 жыл бұрын
Excellent talk. Terrible audio. But excellent talk.
@marissa32482 жыл бұрын
22:11 live coding begins
@MohammedAli-go2uc3 жыл бұрын
Kadena ✅🔥
@WarrenLeggatt3 жыл бұрын
Great talk and props for the King Chrimson shirt :)
@linhe67293 жыл бұрын
Great talk even in 2021!
@s90210h3 жыл бұрын
'I have to get back to Science...' <3 the music was cool af tho the code could watch out for timing 'errors' in the human's playing too perhaps to derive micro timings?
@JosiahWarren3 жыл бұрын
We need more of them
@АнимусАнанимус3 жыл бұрын
23:52 Lmao, George Wilson is there! 😂
@k1m13 жыл бұрын
You are amazing!
@StudentOfKyoto3 жыл бұрын
Amazing talk
@andrewsorenson67503 жыл бұрын
Great name!
@slowpnir3 жыл бұрын
What font does he use?
@GurwinderSingh-mk8db2 жыл бұрын
Iosevka
@droidcrackye52383 жыл бұрын
great work
@Bratjuuc3 жыл бұрын
i'm really glad I stumbled upon this talk. Thanks
@hotpaws_maths_and_science3 жыл бұрын
i like how he says DO DO
@i6g7f3 жыл бұрын
Thank You for this wonderful talk! Very helpful! :) that explain of map and fmap at 1:20 is very very comprehnsible, cool!
@jdubbs96553 жыл бұрын
I am very intrigued. I would like to learn more!
@AshkanKiani3 жыл бұрын
The person dying of consumption in the audience with their phlegmy coughs is really distracting, but the talk is fantastic.
@reen69043 жыл бұрын
lol, tere's a guy with tuberculosis in every meeting