ZILtoid1991@lemmy.world to Programmer Humor@programming.dev · 11 months agoMonadslemmy.worldexternal-linkmessage-square40linkfedilinkarrow-up1265arrow-down110
arrow-up1255arrow-down1external-linkMonadslemmy.worldZILtoid1991@lemmy.world to Programmer Humor@programming.dev · 11 months agomessage-square40linkfedilink
minus-squareleftzero@lemmy.dbzer0.comlinkfedilinkarrow-up15arrow-down2·11 months agoDo you know C#? LINQ? IEnumerable<T>? IEnumerable<T> is a monad. That’s how LINQ works. You’ve been using monads all along.
minus-squaremagic_lobster_party@fedia.iolinkfedilinkarrow-up10·11 months agoOr for those using Java: Stream<T> is a monad
minus-squarepegazz@lemmy.worldlinkfedilinkarrow-up7·11 months agoOptional is my favorite example to give, at this point most people have internalized how to use its map function and how it works
minus-squaremagic_lobster_party@fedia.iolinkfedilinkarrow-up3·11 months agoThat’s a good one. A rule of thumb is that if it has map and flatMap (or equivalent), then chances are that it’s a monad.
Do you know C#? LINQ? IEnumerable<T>? IEnumerable<T> is a monad. That’s how LINQ works.
You’ve been using monads all along.
Or for those using Java: Stream<T> is a monad
Optional is my favorite example to give, at this point most people have internalized how to use its map function and how it works
That’s a good one.
A rule of thumb is that if it has map and flatMap (or equivalent), then chances are that it’s a monad.