Re:The Haskell job market has been growing steaily since 2008
by bPspGiJT8Y on Sunday July 16, 2023 @12:25PM
(#36748707)
Then why not just say that a monad (instance) is a type `t` which implements `bind :: t a -> (a -> t b) -> t b`? It's as down to earth and down to the point as it gets, and each time a new dev thinks out a code path which would lead to `t b` they'd remember `bind`. No need for containers metaphors at all.
[ Parent
| on HN ]
Re:The Haskell job market has been growing steaily since 2008
by PartiallyTyped on Sunday July 16, 2023 @01:18PM
(#36749349)
What’s a `type`? What is `t a`? How do I get `t a`? How does `t b` become `b` when I bind again? Where is `b` after I bind? What about the reader monad and the state monad? Those have different signatures, so what gives?
Re:The Haskell job market has been growing steaily since 2008
by icrbow on Monday July 17, 2023 @06:00AM
(#36756072)
This. Just point to the definition in your language (NOT the category theory, unless that's what you're coding in).
In Haskell, a Monad is a type class with a method `bind`. In Scala that would be a `flatten` or whatever.
If a person who's asking doesn't yet know what the "type class" is, or how to read signatures, your "monad tutorial" would not make much sense anywat. Guide them to learn the prerequisites first.