r/programming • u/emotional-bear • Dec 14 '19
Kleisli composition and other fishy operators
https://functional.christmas/2019/142
u/vegetablestew Dec 14 '19
What language are they using? Looks like Haskell but then angle bracket generics comes in.
4
2
u/bobappleyard Dec 14 '19
That might sound and indeed be confusing, but if you don't think too much about it, it kind of makes sense.
Wat
The reason we are using the bind operator here instead of the Kleisli fishbone operator,
Wat!?!
1
-12
u/memgrind Dec 14 '19
I read it as "here's how to save 1 keystroke, but cause a thousand head-scratches and 100 bugs, while ensuring your job security, while you look smug as no-one else understands it fully at a glance".
10
u/simendsjo Dec 14 '19
I love how your post doesn't refer to a context, and can apply to literally anything :) Everything is head-scratching until you understand it.
0
4
7
u/Solonarv Dec 14 '19
While the footnote "monads don't compose" is true in general - if you pick two arbitrary monads, their composition is not always a monad -
ctx ->in particular does compose with every other monad: Ifmis a monad, thene -> m _is also a monad.