---
# System prepended metadata

title: Untitled

---


Implement a minimal `Option` that has `map` and `flatMap`.


```scala
import scala.{Option => _}

// IMPLEMENT HERE

sealed trait Option[+T] {

  def map[B](f: T => B): Option[B] = 
    this match {
      case Some(v) => Some(f(v))
      case None    => None
    }
    
  def flatMap[B](f: T => Option[B]): Option[B] = 
    this match {
      case Some(v) => f(v)
      case None    => None
    }

}

case object None extends Option[Nothing]
case class Some[+T](value: T) extends Option[T]







```