The Haskell standard library has fromMaybe
equivalent to Scala's getOrElse
.
The Haskell standard library has >>=
which is a generalised version of Scala's
flatMap
pronounced bind.
Introduce Null Object is a degenerate representation that is used when first-class functions and Algebraic Data Types are unavailable. Even when these are unavailable a less contrived possibility exists, however, this requires a significant diversion from canonical use of mainstream programming languages.