de.sciss.optional.Optional.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of optional_2.13.0-RC2 Show documentation
Show all versions of optional_2.13.0-RC2 Show documentation
An implicit option for Scala
The newest version!
/*
* Optional.scala
* (Optional)
*
* Copyright (c) 2016 Hanns Holger Rutz. All rights reserved.
*
* This software is published under the GNU Lesser General Public License v2.1+
*
*
* For further information, please contact Hanns Holger Rutz at
* [email protected]
*/
package de.sciss.optional
import scala.language.implicitConversions
object Optional {
implicit def some[@specialized A](a: A): Optional[A] = new Optional(Some(a))
implicit def apply [A](a: Option [A]): Optional[A] = new Optional(a)
implicit def unapply[A](a: Optional[A]): Option [A] = a.self
}
final class Optional[+A](val self: Option[A]) extends AnyVal with Proxy
© 2015 - 2025 Weber Informatics LLC | Privacy Policy