Cody Mikol
03/11/2021, 11:28 PMeither<L,R> { }
I understand that you can bind getting some value to the context of that either, so I can do something like
val foo = !service.getThingViaEither()
What is the correct way to handle this in conjunction with validation where the return type doesn’t necessarily matter?
Currently I’m doing something like
!Either.conditionally(foo.isValid(), { Error("bar") }, { true }))
I could also do something like
val isValid = !checkFooValid(foo)
but that also seems unnecessary as the isValid val will never be usedCLOVIS
03/12/2021, 7:02 AMval isValid = !checkFooValid(foo)
you could just write
!checkFooValid(foo)
No need to declare a variable you're not using.raulraja
03/12/2021, 9:27 AMcheckFooValid(foo).bind()
invoke
, not
, componentX
are gone.Cody Mikol
03/12/2021, 3:17 PM