fromValidation

A convenience method for the folktale/conversions/validation-to-result module.

Signature

fromValidation(aValidation)
forall a, b: (Validation a b) => Result a b

Documentation

A convenience method for the folktale/conversions/validation-to-result module.

Example:

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

Result.fromValidation(Validation.Success(1));
// ==> Result.Ok(1)

Result.fromValidation(Validation.Failure(1));
// ==> Result.Error(1)

Properties

Source Code

Defined in source/result/index.js at line 18, column 17
fromValidation(aValidation) {
    return require('folktale/conversions/validation-to-result')(aValidation);
  }
Licence
MIT
Module
folktale/result
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)