Created
February 14, 2022 20:02
-
-
Save reevik/11a3f17004e4579b7a4b85b615297dc7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract class Option[+T] { | |
def flatMap[U](f: T => Option[U]) : Option[U] = this match { | |
case Some(x) => f(x) | |
case None => None | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment