|
|
|
|
|
by jarhart
4610 days ago
|
|
Technically, Scala's for comprehensions don't let you mix monads either, but implicit conversions make it work in some cases. For example, there's an implicit conversion from Option to Iterable so the Option (Maybe) and List monads can be mixed. It's really more a matter of Scala's type system allowing it. The Scala compiler just re-writes comprehensions into equivalent higher-order function application. |
|
Works in Scala:
Doesn't work in Haskell: