Mickey Donaghy
12/23/2020, 12:26 AMraulraja
12/25/2020, 10:33 AMfun <E, A, B> Iterable<A>.traverse(f: (A) -> Either<E, B>): Either<E, List<B>>
raulraja
12/25/2020, 10:33 AMMickey Donaghy
12/28/2020, 2:08 AMMickey Donaghy
12/28/2020, 2:10 AMraulraja
01/04/2021, 1:48 PMmap { effect() }
Mickey Donaghy
01/05/2021, 1:49 AMEither
and Option
in this codebase). But understood.raulraja
01/06/2021, 1:12 PMMickey Donaghy
01/07/2021, 1:32 AMval validatedUser = myValidationApplicative.mapN(validateName(nameInput), maybePhoneInput.traverse(myValidationApplicative, validatePhone)) {name, maybePhone -> ValidUser(name, maybePhone)}
raulraja
01/07/2021, 5:38 PMMickey Donaghy
01/08/2021, 12:44 AMmapN
will silently work when some of the fields are optional/either?raulraja
01/08/2021, 12:14 PMMickey Donaghy
01/12/2021, 12:21 AMmapN
part, I was just trying to give some context, the traverse
is the part I was trying to give an example forraulraja
01/12/2021, 9:17 AMIterable<F<A>> -> F<List<A>>
.
This means we can implement multiple versions of Traverse including others without the List if they are concrete but not abstract since the kind emulation would force users to call .fix() in the result. If there is a particular shape you are missing beside the abstraction ability we can look into providing it concrete.Mickey Donaghy
01/13/2021, 9:48 AMEither
and Validation
to start with, but TBH if there's no way to abstract over it then multiple concrete implementations doesn't help that muchraulraja
01/13/2021, 11:53 AMraulraja
01/13/2021, 11:55 AMMickey Donaghy
01/14/2021, 12:35 AM