fromResult

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

Signature

fromResult(aResult)
forall a, b: (Result a b) => Validation a b

Documentation

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

Example:

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

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

Validation.fromResult(Result.Error('error'));
// ==> Validation.Failure('error')

Properties

Source Code

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