How does he make the source code slides use a typewriter animation effect and also have syntax highlighting? I always assumed that any code showing syntax highlighting was screenshot images in Powerpoint, but apparently there's a way to add syntax highlighting to actual text?!
Q: "Get value out of your monad?", A: "You don't." - Well, er, as far as I understand, functions like "Match" (see 40:23) or "Aggregate" or "reduce" or "fold" or what you might call them ARE actually a way of getting information out of the monad, aren't they?
Yes and no. Match and Aggregate are ways to get _a_ value out of certain specific monads, but it doesn't make sense to talk about getting _the_ value out of a monad in general, because some monads like collections and Maybe aren't guaranteed to contain any value at all, so your Aggregate call might just return the seed, and your Match call might just return the nothing value. Furthermore, there are other monads, like Task mentioned here or Haskell's IO whence you cannot extract any value at all (barring esoteric language features well outside the everyday repertoire). (And await is not really extracting a value; it's just a syntactic shortcut for injecting the rest of the function into the monad, at the end of which it will inevitably be wrapped back up in another Task; Haskell actually generalizes this with its do-syntax.) And so you have async operation all the way up to the program entry point in C# and Haskell's main is always of an IO type.
@@andrew_rayI don't think that this is the point. The point is that the answer was "no, you project" and this nor always feasible nor always done. At the end, I see no difference between using a Match to get the value or asking = m.HasValue ? m.Value : nothing .
@@EduardoSilvaLopez But you can't always do that either. Again, take Haskell's IO: you don't to ask if it has a value; it always does. But you can't just ask for the value to be unwrapped, except be the ominously-named `unsafePerformIO`, which from the name you might guess is not something you're calling every day.
@@andrew_ray Maybe but this was not the answer. It was not "you can't do always", it was "you don't do it". And yes, sometimes I do. And for good reasons. If the only option is calling a method called "unsafePerformIO" then I am sorry I think that's bad language design. Sorry.
@@EduardoSilvaLopez There is a reason for that design. In general, Haskell functions must always return the same value when given the same inputs. The only way to ensure that is to avoid interacting with the outside world. The IO monad is an encapsulation of all the interactions between the program and things outside the program. By simple logic, if a function _f_ calls a function _g_ that depends on interactions with the outside world, then function _f_ must also depend on interactions with the outside world. Therefore, it must also bear the IO monad. Bypassing the monad with something like `unsafePerformIO` allows you to create a function that appears not to depend on the outside world but actually does, which limits your ability to reason about your code and also limits the compiler's ability to point out where you've made mistakes. They say of Haskell that is your code compiles, it's probably correct, but that goes out the window when you start throwing around unsafe code.
I really LOVE Mark Seemann’s talks ... he is one of the few engineers/architects who can also teach
I've watched a bunch of monad videos. By far, this is the best!
One of the best talks on the topic
Been waiting for this one to be published so I can show this to my co workers.... Finally. So cool. 👍
25:52 holy hell database querying just turned into a Haskell ‘do’ block!!
Does anyone have any idea what was used for animating the presentation / code moving around?
what if your business method needs to call a domain service that returns Task and await it in order to do one thing or another?
How does he make the source code slides use a typewriter animation effect and also have syntax highlighting? I always assumed that any code showing syntax highlighting was screenshot images in Powerpoint, but apparently there's a way to add syntax highlighting to actual text?!
Aaaah, this is beautiful!
54:25 For more robustness, I would like to see the get-then-set data race handled
Q: "Get value out of your monad?", A: "You don't." - Well, er, as far as I understand, functions like "Match" (see 40:23) or "Aggregate" or "reduce" or "fold" or what you might call them ARE actually a way of getting information out of the monad, aren't they?
Yes and no. Match and Aggregate are ways to get _a_ value out of certain specific monads, but it doesn't make sense to talk about getting _the_ value out of a monad in general, because some monads like collections and Maybe aren't guaranteed to contain any value at all, so your Aggregate call might just return the seed, and your Match call might just return the nothing value.
Furthermore, there are other monads, like Task mentioned here or Haskell's IO whence you cannot extract any value at all (barring esoteric language features well outside the everyday repertoire). (And await is not really extracting a value; it's just a syntactic shortcut for injecting the rest of the function into the monad, at the end of which it will inevitably be wrapped back up in another Task; Haskell actually generalizes this with its do-syntax.) And so you have async operation all the way up to the program entry point in C# and Haskell's main is always of an IO type.
@@andrew_rayI don't think that this is the point. The point is that the answer was "no, you project" and this nor always feasible nor always done. At the end, I see no difference between using a Match to get the value or asking = m.HasValue ? m.Value : nothing .
@@EduardoSilvaLopez But you can't always do that either. Again, take Haskell's IO: you don't to ask if it has a value; it always does. But you can't just ask for the value to be unwrapped, except be the ominously-named `unsafePerformIO`, which from the name you might guess is not something you're calling every day.
@@andrew_ray Maybe but this was not the answer. It was not "you can't do always", it was "you don't do it". And yes, sometimes I do. And for good reasons. If the only option is calling a method called "unsafePerformIO" then I am sorry I think that's bad language design. Sorry.
@@EduardoSilvaLopez There is a reason for that design. In general, Haskell functions must always return the same value when given the same inputs. The only way to ensure that is to avoid interacting with the outside world. The IO monad is an encapsulation of all the interactions between the program and things outside the program. By simple logic, if a function _f_ calls a function _g_ that depends on interactions with the outside world, then function _f_ must also depend on interactions with the outside world. Therefore, it must also bear the IO monad. Bypassing the monad with something like `unsafePerformIO` allows you to create a function that appears not to depend on the outside world but actually does, which limits your ability to reason about your code and also limits the compiler's ability to point out where you've made mistakes. They say of Haskell that is your code compiles, it's probably correct, but that goes out the window when you start throwing around unsafe code.
Any Go implementations of these ideas?
wonderful talk with practical examples
Is there any code available for this talk? Would be keen to see the code of the extensions used in the last slide.
Previously Mark has published the article called "Asynchronous Injection" and this is the accompanying code: github.com/ploeh/asynchronous-injection
anyone know what font is used for that code?
Jesse Poulton Looks like Consolas, stock Microsoft font.
Indeed, it's Consolas 👍
@@MarkSeemann ha really? thats bizarre, looks smoother or smth. Perhaps i just need to up my font size lol
Q: Get value out of your monad?
A: You don't.
great talk
code github.com/ploeh/asynchronous-injection
In this talk he uses the "cool" C# logo 😁
🤯