sidnt / zionotes

⸮ 🔴zio notes | zio nursery 🔵?
0 stars 0 forks source link

R #21

Open sidnt opened 3 years ago

sidnt commented 3 years ago

just how is R used in providing some common functionalities like Console / Clock / Random etc? eg how we are able to just say, console.putStrLn ...

also, by introducing a dependency on a type in a zio value, it is logically but implied that, the required dependency would be used in that zio value, otherwise what's the use of introducing a dependency?

let's say that we are writing a DBService, that can be made available at other places in the application so that they can use the DBService, so that DBService would have crud methods. But then, let's say, these crud methods, need a reference to the DBConnection to actually invoke the db's api. So (a) do we make each crud method zio-value depend on DBConnection? Or do we make the DBService itself depend on DBConnection and so, everywhere inside the DBService, ...?