YannMoisan / hands-on-cats

Discover cats by coding a few simple exercises
82 stars 14 forks source link

scala.Future vs scalaz.Future #12

Open vitamon opened 8 years ago

vitamon commented 8 years ago

Hi! Thank for this great learning by doing resource!

It would be great to also have comparison of scala.Future vs scalaz.Future.

YannMoisan commented 8 years ago

scalaz.Future or scalaz.Task ? Do you think about an example/use case ?

vitamon commented 8 years ago

I guess scalaz.Task is the nearest equivalent to scala.Future. Actually, I don't know scalaz good enough to come up with good example. From the thread https://www.reddit.com/r/scala/comments/3zofjl/why_is_future_totally_unusable/ I can conclude that Tasks are easier to compose and to control executon context and maybe it is easier to handle exceptions. From the other hand the same is achievable with scala futures too.

vitamon commented 8 years ago

https://github.com/indyscala/scalaz-task-intro/blob/master/presentation.md