I will start mentioning I am very new to Scala but I have now to maintain a legacy code where some new feature are being tried to be include. I have ...
I will start mentioning I am very new to Scala but I have now to maintain a legacy code where some new feature are being tried to be include. I have ...
The (covariant) functor definition in cats-laws looks like this: But if I translate the functor composition rule to Scala, it should be: Why a ...
why the second folding compile error ? I think the first folding and the second one are completely same. But the second one arise compile error. imp ...
I want to take input from console in 3 seconds, otherwise in timeout case return "Timeout!". I wrote this function: def withTimeout: IO[String] = C ...
My DAO method types are: The function I need to refactor to make it safe is below: There are 2 problems currently with the function, it calls .g ...
"Source" and "OverflowStrategy" are parts of Akka streams. How can I reimplement below code in FS2? ...
I'm learning the whole Cats-Effect FP framework, and am wondering about how to best implement logging. I'm struggling with finding an elegant way to u ...
Say I have a set of rules that have a validation function that returns IO[Boolean] at runtime. Now I have to iterate through these rules and see "i ...
The below code works fine, but as you can see the 2nd clause in the for comprehension has a call that is unsafe. I tried to make that a safe call, ...
I just found a MonadError code snippet that uses Either like the following import cats.MonadError import cats.instances.either._ // for MonadErro ...
I want to use ArmeriaCatsBackend as sttp backend with Cats effects. The following code does not compile: could not find implicit value for evid ...
I am trying to use Blaze client for http4s to make http calls. It works fine when 200 response is returned but in case of HTTP 500 or 400 I am not abl ...
I want to do the following: Create 100 fibers In each fiber, loop 1000 times and increment my Ref After each fiber has completed 1000 iterat ...
I want to use decline to parse command line parameters for a spark application. I use sbt assembly to create a fat jar and use it in the spark-submit. ...
I am using Scala 3 and http4s 1.0.0-M35. I want to use auth with json handling. But got error It suggests some imports: But after importing i ...
I have the following trait: And I tried to apply the so-called batching transformation to it as follows: The problem is it does not compile with ...
Let us suppose, we have to create the OddList[+T] which contains only odd number of elements. Now can we do something like this if there is no cond ...
I am trying to write a custom Akka SnapshotStore plugin. I am at the point where I want to implement this method: def loadAsync(persistenceId: Strin ...
I have a weird problem with Sbt. I have a Scala zio version set to 1.0.12 in build.sbt: But when I ran application with sbt it downloaded zio in ve ...
I am trying to write some Scala code to have custom behaviour in an mtl style. For example, in order to expose the "write to DB" functionality abstrac ...