Scala Monad
Jump to navigation
Jump to search
A Scala monad is a Scala object with a map method and a flatMap method that satisfy monad axioms.
- Context:
- It can follow the pattern:
.class M[A] {
def map[B](f: A => B):M[B] = ...
def flatMap[B](f: A=> M[B]): M[B] = ...
}
- It can follow the pattern:
- See: Scala Collection Class, Scala Language.