Git Product home page Git Product logo

optional's Introduction

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

optional's People

Contributors

sciss avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.