Get value out of your monad - Mark Seemann

Поділитися
Вставка
  • Опубліковано 1 гру 2024

КОМЕНТАРІ • 34

  • @osman3404
    @osman3404 6 років тому +26

    I really LOVE Mark Seemann’s talks ... he is one of the few engineers/architects who can also teach

  • @DaniloJr
    @DaniloJr 2 роки тому +3

    I've watched a bunch of monad videos. By far, this is the best!

  • @abdulwahabshahid4151
    @abdulwahabshahid4151 Рік тому +1

    One of the best talks on the topic

  • @jchandra74
    @jchandra74 6 років тому +5

    Been waiting for this one to be published so I can show this to my co workers.... Finally. So cool. 👍

  • @TihomirKit
    @TihomirKit 4 роки тому +6

    Does anyone have any idea what was used for animating the presentation / code moving around?

  • @redpepper74
    @redpepper74 2 роки тому +5

    25:52 holy hell database querying just turned into a Haskell ‘do’ block!!

  • @CodeRiff
    @CodeRiff 4 місяці тому

    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?

  • @Xarbrough
    @Xarbrough 11 місяців тому

    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?!

  • @AzazeoAinamart
    @AzazeoAinamart 6 років тому +8

    Aaaah, this is beautiful!

  • @humphreybflaubert
    @humphreybflaubert 5 років тому +1

    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

  • @fuzzylollipop1429
    @fuzzylollipop1429 Рік тому

    Any Go implementations of these ideas?

  • @joebowbeer
    @joebowbeer Рік тому

    54:25 For more robustness, I would like to see the get-then-set data race handled

  • @jessepoulton224
    @jessepoulton224 6 років тому +3

    anyone know what font is used for that code?

    • @hkmix
      @hkmix 6 років тому +3

      Jesse Poulton Looks like Consolas, stock Microsoft font.

    • @MarkSeemann
      @MarkSeemann 6 років тому +2

      Indeed, it's Consolas 👍

    • @jessepoulton224
      @jessepoulton224 6 років тому

      @@MarkSeemann ha really? thats bizarre, looks smoother or smth. Perhaps i just need to up my font size lol

  • @yingliu4203
    @yingliu4203 5 років тому

    wonderful talk with practical examples

  • @inversebrah
    @inversebrah 2 роки тому

    great talk

  • @fjf2002
    @fjf2002 Рік тому +1

    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 Рік тому +1

      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 Рік тому

      @@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 Рік тому

      @@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 Рік тому

      @@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 Рік тому

      @@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.

  • @Endomorphism
    @Endomorphism 4 роки тому +2

    code github.com/ploeh/asynchronous-injection

  • @kahnfatman
    @kahnfatman 2 роки тому +2

    Q: Get value out of your monad?
    A: You don't.

  • @JonathanPeel
    @JonathanPeel 3 роки тому

    In this talk he uses the "cool" C# logo 😁

  • @Tumorlike
    @Tumorlike 10 місяців тому

    🤯