sam
06/06/2019, 4:29 PMsam
06/06/2019, 7:13 PMsam
06/06/2019, 7:14 PMimplicit Fibble[T]
Robert Menke
06/06/2019, 7:19 PMswitchMap
in Arrow that can be used for scenarios like this:
Option
.fromNullable(someValue)
.map { /* calls a function that returns Either<Error, Value> */}
After calling map I have Option<Either<Error, Value>>
wondering if there’s any way to avoid the extra wrapping. CC @Derek SerokyBob Glamm
06/07/2019, 1:51 PMpakoito
06/08/2019, 4:28 PMpakoito
06/08/2019, 4:42 PMpakoito
06/08/2019, 7:15 PMsam
06/09/2019, 5:40 PMsam
06/10/2019, 5:08 PMpakoito
06/10/2019, 6:54 PMpakoito
06/10/2019, 6:55 PMIO.fx
Bob Glamm
06/11/2019, 8:28 PMInputStream
while we know full well that what we really want there is IO.bracket(...)
earroyoron
06/13/2019, 7:22 PMmap
6 flatMap
is just the same as explained there?kioba
06/14/2019, 3:20 PMpakoito
06/17/2019, 9:18 AMsam
06/17/2019, 10:16 PM"myerror".left()
and "myerror".raiseError()
?simon.vergauwen
06/18/2019, 1:37 PMApplicative.map
. Below is an example of combining 4 values by only using map with 2 params. Hope that helps :)
Validated.applicative().map(
Validated.applicative().map(a, b, ::Tuple2),
Validated.applicative().map(c, d, ::Tuple2)
) { (a, b), (c, d=) -> ... }
Marcin Gryszko
06/19/2019, 5:37 AMIO
? (I'm a bit lost in the forest of IO
, Async
and fx
constructors and combinators). Take this example:
suspend fun getCoroutines(internalHotelId: Int): Either<Throwable, CustomerFeedback?> { ... }
I'd like to execute it asynchronously. This is my take:
fun getIOAsync(internalHotelId: Int): IO<CustomerFeedback?> =
IO.async().async { callback ->
GlobalScope.launch {
val result = GlobalScope.async { getCoroutines(internalHotelId) }.await()
callback.invoke(result)
}
}
}
Is this the correct way? Are there any other ways?
Can this be achieved with fx
and effect
?kluck
06/19/2019, 7:07 AMclass InMemoryStorePersistentSource : IStorePersistentSource {
private var store: IO<Option<Store>> = IO { None }
override fun getCurrentStore(): IO<Option<Store>> = store
override fun persistCurrentStore(store: Option<Store>): IO<Unit> = IO { this.store = IO { store } }
}
Bob Glamm
06/19/2019, 5:28 PMDerek Berner
06/19/2019, 5:32 PMDerek Berner
06/20/2019, 8:24 PMFx
instance for EitherT
farzad
06/21/2019, 12:07 PMFunctor
, Applicative
and Monad
. How do you explain these terms for a programmer with OOP background/terminology?Imran/Malic
06/23/2019, 10:46 AMpablisco
06/24/2019, 7:58 AMstreetsofboston
06/24/2019, 3:34 PMRyan Benasutti
06/24/2019, 3:35 PMBrandon Ward
06/24/2019, 5:38 PMTry.invoke{canThrow()}.finally{cleanup()}
Brandon Ward
06/24/2019, 5:44 PMcanThrow()
is a block of assertions, and the cleanup()
is some test cleanupBrandon Ward
06/24/2019, 5:44 PMcanThrow()
is a block of assertions, and the cleanup()
is some test cleanupImran/Malic
06/24/2019, 5:49 PM