aol / cyclops

An advanced, but easy to use, platform for writing functional applications in Java 8.
Apache License 2.0
1.31k stars 136 forks source link

Is there a guide to using Validated? #1097

Open ayush-finix opened 4 years ago

ayush-finix commented 4 years ago

I expected Validated to have an ap method or something, but I can't seem to find it. The only docs I can see are https://github.com/aol/cyclops/wiki/Validator, which clearly isn't the current implementation, and I notice https://github.com/aol/cyclops/issues/826 as another issue, but I don't see the proposed ap method.

ayush-finix commented 4 years ago

Doh, found this: https://medium.com/@johnmcclean/a-simple-functional-java-validation-example-3d2504e97d99.

I guess modifying the question, is there any way to combine like 20 fields of different types? I feel like there should be some way to combine a validated of a <Exception, String> and <Exception, Long> for example. I see a bunch of combine methods in vavr, for example https://www.vavr.io/vavr-docs/#_validation