"The thing about monads is once you finally understand them you immediately lose the ability to explain what they are to others."

Can't remember the author but that's spot on hehe. Who's enjoying their functional journey? I'm a noob of a year and find it fascinating

  • 1
    Deconstructing Functional Programming by Gilad Bracha is where that quote originates from.

    Then some asshole javascript kid called Crockford borrowed it, and got famous for it.
  • 1
    @bittersweet hats down. thank you!
  • 0
    I also don't think Monads are impossible to understand or explain.

    First: a Functor is any polymorphic structure which can be mapped over. I think pretty much all languages have something called an array/list, but a tree/graph/option/dict work too.

    Functor is a category of types whose contents can be transformed through a morphism. They implement Mappable.

    String is not a functor, because it's not polymorphic: If you morph the characters into integers or colors it's not a string anymore.

    A Monad is a special functor for which flatmap can be defined (at any level of Functor nesting).

    To take Haskell, >>= is literally just "flatmap", and return is "construct".

    I think the confusion comes from the fact that programmers and mathematicians use terminology differently. To a mathematician, the Functor is not the structure but the map. Same with Monads: They're either understood to be the nested boxes, or the frantic action of unwrapping, applying actions to contents and wrapping.
Your Job Suck?
Get a Better Job
Add Comment