Тёмный

Get value out of your monad - Mark Seemann 

NDC Conferences
Подписаться 194 тыс.
Просмотров 24 тыс.
50% 1

This talk attempts to answer a pair of frequently asked questions, the first one of which is: how do I get the value out of my monad? It turns out that the answer to that question ultimately addresses another frequently asked question: how do I combine dependency injection with async and await in C# without leaky abstractions?
During the talk, you’ll also get a quick and easy-to-understand explanation of monads. There will also be containers.
All code examples will be in C#.
NDC Conferences
ndcsydney.com
ndcconferences.com

Наука

Опубликовано:

 

10 окт 2018

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 33   
@osman3404
@osman3404 5 лет назад
I really LOVE Mark Seemann’s talks ... he is one of the few engineers/architects who can also teach
@DaniloJr
@DaniloJr 2 года назад
I've watched a bunch of monad videos. By far, this is the best!
@abdulwahabshahid4151
@abdulwahabshahid4151 9 месяцев назад
One of the best talks on the topic
@jchandra74
@jchandra74 5 лет назад
Been waiting for this one to be published so I can show this to my co workers.... Finally. So cool. 👍
@redpepper74
@redpepper74 Год назад
25:52 holy hell database querying just turned into a Haskell ‘do’ block!!
@uglypie182
@uglypie182 5 лет назад
A very approachable intro to many awesome concepts and ideas. Great talk!
@yingliu4203
@yingliu4203 5 лет назад
wonderful talk with practical examples
@AzazeoAinamart
@AzazeoAinamart 5 лет назад
Aaaah, this is beautiful!
@TihomirKit
@TihomirKit 3 года назад
Does anyone have any idea what was used for animating the presentation / code moving around?
@inversebrah
@inversebrah Год назад
great talk
@humphreybflaubert
@humphreybflaubert 5 лет назад
Is there any code available for this talk? Would be keen to see the code of the extensions used in the last slide.
@herowanders9130
@herowanders9130 5 лет назад
Previously Mark has published the article called "Asynchronous Injection" and this is the accompanying code: github.com/ploeh/asynchronous-injection
@Xarbrough
@Xarbrough 6 месяцев назад
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?!
@jessepoulton224
@jessepoulton224 5 лет назад
anyone know what font is used for that code?
@hkmix
@hkmix 5 лет назад
Jesse Poulton Looks like Consolas, stock Microsoft font.
@MarkSeemann
@MarkSeemann 5 лет назад
Indeed, it's Consolas 👍
@jessepoulton224
@jessepoulton224 5 лет назад
@@MarkSeemann ha really? thats bizarre, looks smoother or smth. Perhaps i just need to up my font size lol
@fuzzylollipop1429
@fuzzylollipop1429 Год назад
Any Go implementations of these ideas?
@Endomorphism
@Endomorphism 4 года назад
code github.com/ploeh/asynchronous-injection
@joebowbeer
@joebowbeer 7 месяцев назад
54:25 For more robustness, I would like to see the get-then-set data race handled
@fjf2002
@fjf2002 Год назад
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?
@andrew_ray
@andrew_ray 9 месяцев назад
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.
@EduardoSilvaLopez
@EduardoSilvaLopez 7 месяцев назад
@@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 .
@andrew_ray
@andrew_ray 7 месяцев назад
@@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.
@EduardoSilvaLopez
@EduardoSilvaLopez 7 месяцев назад
@@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.
@andrew_ray
@andrew_ray 7 месяцев назад
@@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.
@Tumorlike
@Tumorlike 6 месяцев назад
🤯
@JonathanPeel
@JonathanPeel 2 года назад
In this talk he uses the "cool" C# logo 😁
@kahnfatman
@kahnfatman 2 года назад
Q: Get value out of your monad? A: You don't.
Далее
Dependency Injection revisited - Mark Seemann
56:02
Просмотров 8 тыс.
Domain Modeling Made Functional - Scott Wlaschin
51:35
Беда приходит внезапно 😂
00:25
Просмотров 765 тыс.
Самое Романтичное Видео ❤️
00:16
What the Heck Are Monads?!
21:08
Просмотров 69 тыс.
Refactoring to Immutability - Kevlin Henney
1:03:22
Просмотров 93 тыс.
F# for C# programmers - Scott Wlaschin
1:00:01
Просмотров 68 тыс.
Fractal architecture - Mark Seemann - NDC London 2022
54:31
Thirteen ways of looking at a Turtle -  Scott Wlaschin
1:04:42
Four Languages from Forty Years Ago - Scott Wlaschin
1:01:45
ОБСЛУЖИЛИ САМЫЙ ГРЯЗНЫЙ ПК
1:00
OZON РАЗБИЛИ 3 КОМПЬЮТЕРА
0:57
Просмотров 1,5 млн
Сравнили apple и xiaomi!
0:21
Просмотров 48 тыс.