of

Constructs a Maybe value that represents a successful value (a Just).

Signature

of(value)
forall a: (a) => Maybe a

Documentation

Constructs a Maybe value that represents a successful value (a Just).

NOTE:
The provided value is stored as-given in the structure. If you want to convert a nullable value (a value that may be null/undefined) to a Maybe value, use the Maybe.fromNullable(value) function instead of Maybe.of(value).

See the documentation for the Maybe structure to understand how to use this.

Properties

Source Code

Defined in source/maybe/maybe.js at line 268, column 21
of(value) {
    return Just(value);
  }
Stability
stable
Licence
MIT
Module
folktale/maybe/maybe
On This Page
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)