Dear all,
I'm kind of struggling with fj's Validation. Here is my use case :
in the following method :
G method(A param1, B param2, C param3)
I would like to apply the following function :
F<A, Validation<E, F<B, Validation<E, F<C, Validation<E, D>>>>>> f1
using param1, 2, and 3 and accumulating possible failures in a Semigroup<E> ;
this I think would provide me a Validation<E, D> from which it would be
easy to obtain the desired G.
And there I lie, wondering how to ignite the wick...
I read Tony Morris' following article and presentation :
http://blog.tmorris.net/automated-validation-with-applicatives-and-semigroups-part-2-java/
and
http://applicative-errors-scala.googlecode.com/svn/artifacts/0.6/html/index.html
; while very instructive, I was presumably not able to fully lick the
substantial marrow out of them, unless they simply didn't addressed my
point ?
Indeed, in those examples, the validation concern seems to be separated
from the application concern (i.e the function to be eventually applied
(Person.person in the second example) does not bear any Validation in
its type signature). I could follow this path, but I like the idea of
the functions bearing in their types the possibility of their failure.
I suspect I'm missing something obvious ; a hint or two that would make
it appear would be much appreciated.
Regards,
G.N
--
Grégoire Neuville