-
Notifications
You must be signed in to change notification settings - Fork 138
Closed
Milestone
Description
Can be implemented in terms of an Either with a NonEmptyList on the left side.
The accumulate methods on Either aren't sufficient to accumulate validation errors. Validated should have a zip / ap method but flatMap should be renamed due to behavioral conflict with ap / zip (Cats uses andThen).
class Validated<E,T>{
Either<NonEmptyList<E>,T> validated;
<R> R fold(Function<? super T, ? extends R> valid, Function<? super NonEmptyList<E>,? extends R> invalid);
public Validated<E,T> ap(Function<? super T, ? extends Validated<E,R>> fn);
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels