sciss / optional   1.0.1

Contributors Wanted GNU Library General Public License v2.1 only GitHub

An implicit option for Scala. Mirror of https://codeberg.org/sciss/Optional

Scala versions: 3.x 2.13 2.12
Scala.js versions: 1.x

Optional

Build Status Maven Central

statement

Optional is a microscopically small (6 lines) library for Scala to provide a variant of Option, called Optional that provides an implicitly defined value. Instead of

def foo(x: Option[Int]) = x.getOrElse(-1)

foo(Some(123))

You can now write

import de.sciss.optional._

def foo(x: Optional[Int]) = x.getOrElse(-1)

foo(123)

This is useful for some DSLs where you want to minimise noise for the user.

Optional is (C)opyright 2016–2021 by Hanns Holger Rutz. All rights reserved. FileUtil is released under the GNU Lesser General Public License v2.1+ and comes with absolutely no warranties. To contact the author, send an e-mail to contact at sciss.de.

requirements / installation

This project builds with sbt against Scala 2.13, 2.12, Dotty (JVM) and Scala 2.13 (JS). The last version to support Scala 2.11 was v1.0.0.

To use the library in your project:

"de.sciss" %% "optional" % v

The current version v is "1.0.1"

contributing

Please see the file CONTRIBUTING.md