All Downloads are FREE. Search and download functionalities are using the official Maven repository.

poly.algebra.std.OptionStructure.scala Maven / Gradle / Ivy

package poly.algebra.std

import poly.algebra.hkt._

/**
 * @author Tongfei Chen
 */
object OptionStructure extends Monad[Option] {

  def flatMap[X, Y](ox: Option[X])(f: X => Option[Y]) = ox flatMap f
  def id[X](u: X) = Some(u)
  override def map[X, Y](ox: Option[X])(f: X => Y) = ox map f

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy