in both cases there’s no way of generating an `a` ...
# arrow
p
in both cases there’s no way of generating an
a
of type
Int
from the
Invalid
origin, so those lambdas that you pass cannot be called and the internal function calls won’t execute to create a new Validated that accumulates errors
s
But in those cases the map wouldn't be excuted right. Just like None.map { } doesn't do anything.
p
yep
so no error accumulation for you
s
I think I see
You're saying the function must always be executed because it needs to combine the result
Rather than just not run at all like in other monads
p
it needs to combine the errors, which is what you want
s
I get it now
I'm slow
p
if it doesn’t execute the next value of map or flatMap you won’t accumulate the validations
you’re allright
😄
s
So what about a method on Validated which only runs if it's a valid.
Like for each on option in scala
p
that’s fold, right?
s
Does that exist. Different question
Ok I'll check fold. I'm on my phone atm
p
and map
s
When I get back I'll ask some more questions on combining eithers via map
👍🏼 1