value

The value contained in an Error instance of the Result structure.

Signature

get value()
forall a, b: get (Result a b) => a

Documentation

The value contained in an Error instance of the Result structure.

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

Example:

const Result = require('folktale/result');

Result.Error(1).matchWith({
  Error: ({ value }) => value,    // equivalent to (x) => x.value
  Ok:    ({ value }) => 'nothing'
});
// ==> 1

Properties

Source Code

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