3 ms·
Well, so far the “better” still remains to be seen... waiting for type-classes to represent monoids, functors, applicatives, monads and foldable. So far I’ve j
by eecc 6y ago
Well, so far the “better” still remains to be seen... waiting for type-classes to represent monoids, functors, applicatives, monads and foldable.
So far I’ve just seen a complex and wild stream API that mimics it in practice, without all the mental model behind it.
Oh, and what’s this nonsense with Java Option?! Really?
- vips7L 6y agoWe're yet to see if monoids, functors, and monads are worth it :) For better I'd say you should look at things like virtual threads vs async/await or kotlins when vs switch expressions.
- dtech 6y agoIf you program modern Java or Kotlin map and flatMap are everywhere. I'd say the debate whether functors and monads are useful is over.
- _old_dude_ 6y agoJava or Kotlin support functors or monads as design patterns, i.e. this is how a map/flatMap works with an Optional or a Stream. The question is: if this support is enough or should the type system be enhanced so you can abstract over/compose a functor and/or a monad ? The answer to this question is IMO still open.
- eecc 6y agoNo they are. Seriously, the mental effort I had to endure to hold all these wild APIs in my head! In hindsight it’s infuriating; the gatekeeping, the patronizing condescendence when I was struggling with what are mathematical trivialities. Screw that... I should have been told sooner