Essential Effects - Singapore Scala Programmers - Shared screen with speaker view
You certainly may! :D
Scala novice here. How come the println doesn’t run when we construct the MyIO? Is it like a macro?
been using cats effect for a while and the hard part is on educating fellow developers that these functions have side effects but they don’t run till you pass them into the IO interpreter.
Ah, that makes sense
it should take alambda
sorry I’m getting ahead of myself there ;)
It’s we are writing a definition of what we want to do and then do it later
it does not run because it is a thunk
Isn’t a thunk a partially evaluated result?
it is evaluated when invoke, lazily
A thunk is just a lambda
A nullary lambda, perhaps?
in kotlin you would write it like (unsafe : () ->A,) in scala it is so common that that the syntax is adjusted so that it looks like unsafe: => A
I like how the guts of IO are exposed here as opposed Haskell’s blackbox IO
if a future is in an IO, does it have the behavior of an IO or that of a future ?
I am actually outside due to some circumstance. I need to leave for some reason. sorry, see you everyone 👋😅 thank you for this awesome session, Adam 😄😍
“It’s always traverse”
haha - yes that is always the anwer
I have a question - about the error failues of parMapN - should it not run them all and return all the errors? When I see MapN I just think of the MapN from the Validate Applicative in cats
question: Are we using a thread pool in the background when we use the par* functions?
there are 3 thread pools
IOApp sounds like “executor” in Rust
Except there it’s only for async
Futures, I mean
I guess that makes sense, but I just expected there to be a version that is like Either[Nel[Error], A ]
Thanks - makes sense
do I still need parMapN when I use blocker, as the job encapsulated in blocker is run in separate thread anyway ?
I believe it's different use cases, AFAIK parMapN will run on the current context, whereas blocker will context switch to the blocker context.
Thanks Adam and Herdy! :) I will do experiment
Could you talk a little bit more about this abstract F[_] that I always see in cats effect code bases. If it’s abstract how do I think about how it’s executed?
great book - buy it
very awesome !
Thanks Adam! Great talk.
I have a question on transitioning to cats effects. If you have a large app that uses cats and akka-http for networking and slick for database access. That use other monads like DBIO. How would you start the transitioning.
And also - thanks for a great talk.
What additional books do you recommend for someone who’s completely new to Scala?
that book is a bible
I second renghen - it is a great great book
Example of such a codebase: https://github.com/gvolpe/advanced-http4s/blob/master/src/main/scala/com/github/gvolpe/http4s/server/endpoints/FileHttpEndpoint.scala
also another good book
Thanks for the recess!
Thanks Adam! It's a great talk.
thanks Adam for the presentation :) I gotta go for a meeting ! c u on the internet
creativescala.org for beginners
Tons of other books here too https://underscore.io/books/
Thank you so much Adam! Great talk!
Is essentialeffects.dev book for unsafe Scala programmer transitioning to cats effect ?
Do these techniques work with Scala Native?
I doubt the executor stuff works in Scala native. It depends on the jvm executors iiuc.
Thanks for a great talk
awesome stuff! thanks for the talk and for answering our questions!