Hacker News new | ask | show | jobs
by kilovoltaire 3943 days ago
For one example, Scala's `for` syntax is quite similar to Haskell's `do` notation, and lets you do some monadic things with `Option`, `Seq`, and other classes.

And then you can go much further into that world with the scalaz library.

1 comments

This! Something that never fails to surprise me is that, while I have a mostly Java background for my day job, after we adopted Scala I often find it easier to understand/prototype a function in Haskell (my hobbyist language).

One of those things was Scala's `for` (and `flatMap`). It clicked for me once I noticed how similar it was to Haskell's `do` notation for Monads.

What's surprising to me is that it would seem Haskell has no right to be this helpful for understanding production code!