Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

Validation is not a monad #1

Closed
puffnfresh opened this issue Dec 14, 2013 · 1 comment
Closed

Validation is not a monad #1

puffnfresh opened this issue Dec 14, 2013 · 1 comment

Comments

@puffnfresh
Copy link

If validation were a monad, the following two expressions would be equal:

x.map(function(a) {
  return function(b) {
    return [a, b];
  };
}).ap(y);

x.chain(function(a) {
  return y.map(function(b) {
    return [a, b];
  });
});

It's not possible to make those be equal in the case that both x and y are failures.

The project should also be renamed to something like applicative.validation to avoid further confusion.

@puffnfresh
Copy link
Author

Woo! Thanks 👍

@robotlolita robotlolita mentioned this issue Jun 2, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant