|
|
|
|
|
by ebola1717
3197 days ago
|
|
Eh, as someone who works in scala day-to-day, and has studied actual category theory, I think the emphasis on category theory itself is silly. And in fact, most of the time, more category theory and more monads will make your code worse (e.g. MonadTransformers are D: ) Future, which is really a souped up promise abstraction, is the main star, and for-comprehensions are nice syntactic sugar. Being a "Monad" doesn't help you do anything with it though. And Future technically doesn't even truly obey the Monad laws, because of exceptions. It's useful that a couple of container classes in scala use implement this trait: trait ChainableContainer[A] {
def map(fn: A => B): ChainableContainer[B]
def flatten(nested: ChainableContainer[ChainableContainer[A]]):ChainableContainer
}
But beyond making it a little easier to guess what's going on, the underlying math isn't useful in actual programming. |
|
Future also doesn't obey the monad laws for not being RT and that causes a lotttt of complexity.