pakoito
03/29/2019, 11:15 AMJannis
03/29/2019, 11:38 AMDavid Podhola
03/31/2019, 5:46 AMImran/Malic
03/31/2019, 8:55 AMsimon.vergauwen
04/02/2019, 4:56 PMsequence: (List<Option<A>>) -> Option<List<A>>
which yields Some
if all options were Some
or None
if one of them was empty.streetsofboston
04/04/2019, 4:36 PMraulraja
04/05/2019, 10:19 AMCatchIO<E, A> // base IO that has built in bifunctor and its parametric to E
typealias IO<A> = CatchIO<Throwable, A>
typealias EnvIO<R, E, A> = R.() -> IO<E, A>
We are open to new names or suggestions that are easy for users so feel free to comment on this message in a thread and we can look into different optionspakoito
04/05/2019, 1:55 PMNothing
for the fields they don't use.ivanmorgillo
04/05/2019, 5:57 PMAdrianRaFo
04/11/2019, 11:02 AM@extension
export the extension functions from a type class
interface Functor<F> {
fun <A, B> Kind<F, A>.map(f: (A) -> B): Kind<F, B>
}
to inheritors
@extension interface IOFunctor : Functor<ForIO> {
override fun <A, B> Kind<ForIO, A>.map(f: (A) -> B): IO<B> =
fix().map(f)
}
ivanmorgillo
04/12/2019, 8:25 AMImran/Malic
04/12/2019, 7:57 PMpakoito
04/13/2019, 2:52 PMraulraja
04/14/2019, 11:36 AMSergio Crespo Toubes
04/16/2019, 3:41 PMoverride fun getElements(): Either<Throwable, List<Element>> {
return elementsApi.getElements(authToken)
.async(IO.async())
.fix()
.unsafeRunSync()
.unwrapBody(Either.applicativeError())
.fix()
}
This is working for me, but is the good way for using arrow with retrofit? getElements
return CallK object.than_
04/18/2019, 9:09 AMKind<F,A>
type for example to map it to Kind<F,B>
?Imran/Malic
04/18/2019, 2:17 PMkluck
04/18/2019, 3:01 PMkluck
04/19/2019, 2:34 PMfun getStore(): CallK<StoreDto>
. On the repository layer, I'd like to obtain a Store, but as it might come from the network, I guess it should be wrapped in an IO like so: fun getStore(): IO<Store>
.
My problem resides in the fact that I don't find where I should do my mapping from StoreDto to Store. I have something like this for now:
kotlin
apiCall.async(IO.async())
.fix()
.unsafeRunAsync { either ->
either.fold( // <-- the result of this is what I'd like to get
{ IO.raiseError<Store>(it) },
{ retrofitResponse ->
retrofitResponse.unwrapBody(Either.applicativeError()).fix().fold(
{ IO.raiseError(it) },
{ storeDto -> IO.just(Store(storeDto.name)) }
)
}
)
}
But this actually execute the code at the repository level, and doesn't return my expected type. I'd like to actually execute this at a higher level, say my android activity in my presentation layer. Any tips on what direction I should take? I'm trying to get inspiration from https://github.com/JorgeCastilloPrz/ArrowAndroidSamples , but I don't understand all that is done there at the DataSource level…Imran/Malic
04/19/2019, 9:09 PMImran/Malic
04/20/2019, 8:28 AMpakoito
04/21/2019, 2:26 AMhandle exception throwingThere’s
Try
, and we’re on the way of deprecating it in favor of Fx
Imran/Malic
04/21/2019, 8:22 PMstarke
04/23/2019, 3:06 PMOption<Int>
values?simon.vergauwen
04/26/2019, 8:07 AMval c = a.flatMap { aRight ->
b.map { bRight ->
bRight + aRight.toString()
}
}
dewildte
04/27/2019, 3:37 AM0.9.1-SNAPSHOT
in a build.gradle.kts
file?Bob Glamm
04/29/2019, 12:34 PMTrevor
04/29/2019, 11:52 PMpakoito
04/30/2019, 9:48 AMpakoito
04/30/2019, 9:48 AMsimon.vergauwen
05/01/2019, 9:01 PM