value

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

Signature

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

Documentation

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

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

Example:

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

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

Properties

Source Code

Defined in source/validation/validation.js at line 45, column 26
get value() {
    throw new TypeError('`value` can’t be accessed in an abstract instance of Validation.Failure');
  }
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/)