value

The value contained in a Just instance of the Maybe structure.

Signature

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

Documentation

The value contained in a Just instance of the Maybe structure.

This is usually used to destructure the instance in a .matchWith call.

Example:

const Maybe = require('folktale/maybe');

Maybe.Just(1).matchWith({
  Just: ({ value }) => value, // equivalent to (x) => x.value
  Nothing: () => 'nothing'
});
// ==> 1

Properties

Source Code

Defined in source/maybe/maybe.js at line 44, column 23
get value() {
    throw new TypeError('`value` can’t be accessed in an abstract instance of Maybe.Just');
  }
Licence
MIT
Module
folktale/maybe/maybe
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)