Derek Berner
05/29/2019, 2:31 PMTry<Unit>
is wrong but it's only because Try
is soon to be deprecated, not because of the Unit type param.Bob Glamm
05/29/2019, 7:34 PMraulraja
05/29/2019, 7:35 PMBob Glamm
05/30/2019, 1:02 PMsam
05/31/2019, 2:22 AMraulraja
05/31/2019, 11:33 AMsam
05/31/2019, 11:54 AMsam
05/31/2019, 8:06 PMOption.fromNullable
to be very verbose. Isn't the point of option that you may or may not have a nullable value, and so shouldn't Option(t) accept a nullable ?pakoito
06/02/2019, 1:09 AMReaderT.monad<F, AccountRepository<F>>(this).tupled(debit(from, amount), credit(to, amount))
pakoito
06/02/2019, 1:58 AMapplicative().map(val1, val2, val3) { a, b, c -> SomeClass(a, b, c) }
pakoito
06/02/2019, 9:07 AMa
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 errorssam
06/02/2019, 10:36 PMarrow.data.extensions.option.monad.binding
sam
06/03/2019, 10:32 AMval (nuke) = arm()
if you remove the parenthesis it fails to extractsnackycracky
06/03/2019, 10:42 AMraulraja
06/03/2019, 2:57 PMfun validateExpiryDate(date: LocalDate): ValidatedNel<ValidationError, LocalDate> =
if (logic) date.validNel() else Expired.invalidNel()
raulraja
06/03/2019, 3:02 PMimport arrow.data.extensions.validated.apply.map
raulraja
06/03/2019, 3:09 PMthis
and does not delegate to the platform dependent trace stuffraulraja
06/03/2019, 3:10 PMfun <A> Try<A>.toValidatedNel(): ValidatedNel<Throwable, A> =
fold({ it.invalidNel() }, { it.validNel() })
sam
06/03/2019, 3:11 PMsam
06/03/2019, 3:16 PMpakoito
06/04/2019, 7:41 AMsimon.vergauwen
06/04/2019, 7:42 AMsam
06/04/2019, 12:28 PMsam
06/04/2019, 12:45 PMsimon.vergauwen
06/04/2019, 12:45 PMsuspend fun foo() = start().flatMap { a ->
bar(a).flatMap { b ->
update(b).map { result(c)
}
}
raulraja
06/04/2019, 2:22 PMsuspend
we may even lift that restriction in fx
down the road but in whatever case the biz about getting rid of Either is that IO is gonna be soon IO<E, A>
so you don't need Either
because you can do just(a)
or raiseError(e)
and that is the same as Either. You can also do raiseError(exception)
.Derek Berner
06/04/2019, 3:07 PMraulraja
06/04/2019, 9:27 PMImran/Malic
06/05/2019, 2:34 PMRobert Menke
06/05/2019, 9:35 PM//left to right
infix fun <A, B, C> ((A) -> B).andThen(right : (B) -> C) : (A) -> C = {
arg -> right(invoke(arg))
}
//right to left
infix fun <A, B, C> ((B) -> C).compose(right : (A) -> B) : (A) -> C = {
arg -> invoke(right(arg))
}
Robert Menke
06/05/2019, 9:35 PM//left to right
infix fun <A, B, C> ((A) -> B).andThen(right : (B) -> C) : (A) -> C = {
arg -> right(invoke(arg))
}
//right to left
infix fun <A, B, C> ((B) -> C).compose(right : (A) -> B) : (A) -> C = {
arg -> invoke(right(arg))
}
streetsofboston
06/05/2019, 9:36 PMRobert Menke
06/05/2019, 9:37 PMstreetsofboston
06/05/2019, 9:37 PMRobert Menke
06/05/2019, 9:37 PMstreetsofboston
06/05/2019, 9:39 PMpakoito
06/05/2019, 10:00 PMdh44t
06/06/2019, 4:14 AM