Jorge Castillo
10/17/2019, 5:53 PMghedeon
10/18/2019, 7:50 AMTry
in data layer, then map to Either
for domain". Am I on the right track? Any good hands-on articles, like "Retrofit + Arrow, error handling"? Thank you.thanh
10/18/2019, 8:44 AMFrancesco megna
10/20/2019, 3:24 PMpakoito
10/20/2019, 3:34 PMpakoito
10/20/2019, 3:34 PMraulraja
10/20/2019, 10:44 PMHarryPulvirenti
10/21/2019, 8:34 AMsuspend fun findLocation() = coroutineScope {
locationDelegate.checkSettings().flatMap {
locationDelegate.getLocation()
}
}
In this sample, I can’t call locationDelegate.getLocation()
since the getLocation()
is a suspend function. How can I handle suspend functions in flatMap
since it is not an inline function?jimn
10/22/2019, 1:39 AMTom Hall
10/22/2019, 4:05 PMRyan Benasutti
10/23/2019, 1:12 AMIO
(lazy, safe, etc.) that does not use Throwable
for the error type? My main issue is that IO.raiseError
needs a Throwable
and in my use case, constructing a stacktrace is too expensive.Pagoda 5b
10/23/2019, 4:30 AMMatt Thiffault
10/23/2019, 5:19 AMPagoda 5b
10/23/2019, 6:55 AM.void()
function for any Functor
that does nothing more than Functor.map(it -> ())
raulraja
10/23/2019, 12:00 PMEither.catch
but really you should be using IO if you are dealing with effectsPagoda 5b
10/23/2019, 12:09 PMpakoito
10/23/2019, 3:38 PMfix()
and sequence(Either.applicative())
needed all around. Ideally not at all 🙂Saša Šijak
10/24/2019, 11:05 AMraulraja
10/24/2019, 11:14 AMpakoito
10/24/2019, 11:57 AMEither.catch { }
which accepts suspend functions inside tookarelpeeters
10/24/2019, 8:50 PMoperator fun invoke
in `Either.Left`: why is it there? It looks like a constructor but I can't think of a case where the behavior would be different from just making the constructor public instead. It made sense for kategory when Either.Left
had two type parameters so you wouldn't have to specify the Nothing
type explicitly (https://github.com/JcMinarro/kategory/blob/master/kategory-core/src/main/kotlin/kategory/data/Either.kt#L125), but why does arrow have it too? (https://github.com/arrow-kt/arrow/blob/master/modules/core/arrow-core-data/src/main/kotlin/arrow/core/Either.kt#L818).
For that matter, why did Either.Left
ever have two type parameters in kategory?jimn
10/26/2019, 1:06 PMjimn
10/26/2019, 1:53 PMRyan Benasutti
10/26/2019, 4:55 PMIO::bracket
works well when you have something like this:
IO { take a resource safely }.bracket(release = { give it back }, use = { use it in a way that can fail })
but what about the case where taking the resource can also fail? Is there a method that can handle this, or do I need another bracket
?aballano
10/27/2019, 5:19 PM4.2 Day Convolution
Another common pattern is to display two user interfaces
side-by-side, with their states evolving independently.
A comonad to specify such an interface would again need
to store all future states of both components, and we would
also need a function to render any two current states. This
data is captured by the Day convolution of the
two functors
pakoito
10/28/2019, 8:53 PMFrancesco megna
10/28/2019, 9:47 PMA problem occurred evaluating project ':arrow-meta'.
> tools.jar not found at your JAVA_HOME dir /Applications/IntelliJ IDEA <http://CE.app/Contents/jbr/Contents/Home|CE.app/Contents/jbr/Contents/Home>.
Building with a JRE or JDK9 is currently not supported.
raulraja
10/29/2019, 8:12 AMJannis
10/29/2019, 4:45 PMpakoito
10/29/2019, 5:18 PMpakoito
10/29/2019, 5:18 PMJannis
10/29/2019, 5:40 PMpakoito
10/29/2019, 5:41 PMkotlinfmt
to piss off people 😄Jannis
10/29/2019, 5:42 PMkotlinfmt
is just evil^^