merge

Returns the value inside of the Result structure, regardless of its state.

This feature is experimental!

This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.

Signature

merge()
forall a, b: (Result a b).() => a or b

Documentation

Returns the value inside of the Result structure, regardless of its state.

Example:

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

Result.Ok(1).merge();
// ==> 1

Result.Error(1).merge();
// ==> 1

Properties

Source Code

Defined in source/result/result.js at line 327, column 22
merge() {
    return this.value;
  }
Stability
experimental
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/)