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

Validation is not a monad #1

@puffnfresh

Description

@puffnfresh

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions