---
# System prepended metadata

title: Untitled

---

Implement a minimal `Option` that has `map` and `flatMap`.
```scala
import scala.{Option => _}
// implement here




//think about restrictions in T
sealed trait Option[+T]{
    
    def map[U](mappingFunct: T=>U): Option[U] = 
        this match {
            case None => None
            case Some(e) => Some(mappingFunct(e))
        }
    
    def flatMap[U](mappingFunct: T=>Option[U]): Option[U]  = 
        this match {
            case None => None
            case Some(e) => mappingFunct(e)
        }
}

case object None extends Option[T]
case class Some[T](element: T) extends Option[T]



val a: Option[Int] = ???
a.map(i => i + 1)

val none: Option[Int] = None

sealed trait Animal
case object Cat extends Animal

val none: Option[Animal] = None
val myAnimal: Option[Animal] = Some(Cat)


val x: Option[Int] = Some(10)
x.map(_ + 1)
```