streetsofboston
07/29/2019, 2:28 PMSatyam Agarwal
07/29/2019, 4:30 PMparTraverse
and it works after spending my whole Sunday to make it work, but I can’t grasp why it works. Thus the questions. Can you help me understand it please. Here is the gist :
https://gist.github.com/satyamagarwal/336f02954fa4dc369fdea6524f593d1asam
07/29/2019, 8:51 PMBob Glamm
07/30/2019, 2:18 AMfun <F> IO<F>.runner(connection: Connection): JDBCOps<F> =
object: JDBCOps<F>, Fx<F> by this, Bracket<F, Throwable> by this {
doesn't work because Fx<F> is not Bracketpakoito
07/30/2019, 5:29 PMPhBastiani
07/31/2019, 3:25 PMFree.monad()
Today, i tried to translate de Scala Cats sample into Kotlin (see https://gist.github.com/PBastiani/3598c838cbfdd982238360244b7550ed)
Something seems wrong in the interpreter : i understand that in my FREE program FreeKVStore<Unit>
is in conflict with Kind<F, A>
! But, I don't know how to fix that...carbaj0
08/01/2019, 10:21 AMBob Glamm
08/01/2019, 2:30 PMRyan Benasutti
08/04/2019, 4:03 AMIO.handleError { }
that doesn't require I provide an IO<A>
(perhaps one which requires an IO<Unit>
)? I have a method which returns an IO<A>
, but I need to guarantee certain additional IO operations happen if the former IO fails (and in this case, I can't return an IO<A>
because that part failed).Bob Glamm
08/05/2019, 12:55 PMval (r1) = query("...", mapper1); val r2 = computation(r1); val (r3) = update("...");
then I'm back to monads and trying to run suspend blocks outside of coroutine scope if I don't have fx
nested inside transaction
rcd27
08/06/2019, 9:37 AMMapK.traverse(..)
method. Any code of how to use it?Pagoda 5b
08/06/2019, 12:02 PMpakoito
08/06/2019, 1:27 PMsimon.vergauwen
08/06/2019, 7:07 PMfollowedBy
over flatMap { _ ->
or bind
.Satyam Agarwal
08/06/2019, 7:20 PMdirect imperative syntax
(which i am not leveraging here) from a function with returning type IO if I execute my IOs in fx ?
for example :
import <http://arrow.fx.IO|arrow.fx.IO>
import arrow.fx.extensions.fx
fun someFun(): IO<Unit> = IO { println("hey") }
fun anotherFun(): IO<Unit> = IO { println("hey again") }
fun main() {
someFun().followedBy(anotherFun()).unsafeRunSync()
}
fun mainMain() {
IO
.fx {
someFun().followedBy(anotherFun()).bind()
}
.unsafeRunSync()
}
main()
mainMain()
pakoito
08/06/2019, 8:19 PMBob Glamm
08/07/2019, 1:21 PMfun <A> service(): Kind<F, A> = transaction {
val (r1) = query(QUERY1, query1Mapper)
val (r2) = query(QUERY2, query2Mapper)
combine(r1, r2)
}
Now to add things like better update/insert support and eliminate some ugly refs to fx.monadThrow
within the mappers. Could not have done this without your help. Thanks!carbaj0
08/09/2019, 6:24 AMnoiano
08/09/2019, 8:15 AM(List<Try<A>>) -> List<A>
with a simple flatmapRobert Menke
08/10/2019, 8:13 PMOptionT
(or any of the MonadT
) constructors been moved/replaced in the 0.10.0-snapshot? Can’t seem to figure out how to import/install them.Robert Menke
08/11/2019, 1:22 AMthanh
08/11/2019, 5:23 PMfun <T, R> Observable<Either<Throwable, T>>.flatMapEither(mapper: (T) -> Observable<R>): Observable<Either<Throwable, R>> {
return flatMap {
when (it) {
is Either.Right -> mapper(it.b).map { it.right() as BeckonResult<R> }
is Either.Left -> Observable.just(it)
}
}
}
thanh
08/11/2019, 5:42 PMRyan Benasutti
08/11/2019, 7:18 PMListK.applicative()
and tupled(listA.k(), listB.k()
, I can generate all `Tuple2`'s with the elements in both lists. If I give more arguments to tupled
, then I get a Tuple3
, etc. Is there a way to give more arguments to a method like tupled
but still only get a Tuple2
out? I want to get all the pairs of elements between n lists.Bob Glamm
08/11/2019, 7:44 PMstojan
08/12/2019, 6:15 AMDerek Berner
08/12/2019, 9:51 PMaeruhxi
08/13/2019, 7:21 AMfun <K, V, R> Map<out K, V>.map(
transform: (Entry<K, V>) -> R
): List<R>
Why does map
for Map
in stdlib return List
instead of Map
?Bob Glamm
08/13/2019, 2:05 PMBob Glamm
08/13/2019, 2:06 PMBob Glamm
08/13/2019, 2:06 PMsimon.vergauwen
08/13/2019, 2:13 PM