value

The value contained in an Success instance of the Validation structure.

Signature

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

Documentation

The value contained in an Success instance of the Validation structure.

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

Example:

const Validation = require('folktale/validation');

Validation.Success(1).matchWith({
  Success: ({ value }) => value,    // equivalent to (x) => x.value
  Failure: ({ value }) => 'nothing'
});
// ==> 1

Properties

Source Code

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