sealed trait Maybe[+A] { // >>= def flatMap[B](f: A => Maybe[B]): Maybe[B] = this match { case Just(a) => f(a) case MaybeNot => MaybeNot } }