Thread pools on the JVM should usually be divided into the following three categories:
- CPU-bound
- Blocking IO
- Non-blocking IO polling
Each of these categories has a different optimal configuration and usage pattern.
import * as pulumi from '@pulumi/pulumi'; | |
import * as gcp from '@pulumi/gcp'; | |
import * as k8s from '@pulumi/kubernetes'; | |
import * as k8sInputApi from '@pulumi/kubernetes/types/input'; | |
const serviceAccountKeys = new Map<string, gcp.serviceAccount.Key>(); | |
/** | |
* Creates a service account and key, and sets the cloudsql.client role in IAM. | |
*/ |
import java.net.URI | |
import cats.effect._ | |
object Main extends IOApp { | |
override def run(args: List[String]): IO[ExitCode] = | |
RedisClient.makeWithURI[IO](new URI("http://localhost:6379")).use { cmd => | |
import cmd._ | |
val result = for { |
import cats.data.ValidatedNec | |
import cats.implicits._ | |
import eu.timepit.refined._ | |
import eu.timepit.refined.api.Refined | |
import eu.timepit.refined.auto._ | |
import eu.timepit.refined.numeric._ | |
import eu.timepit.refined.collection._ | |
object person { |
Let's take a simple example that models an employee along with the salaries accrued in a year. Here's the domain model in Scala:
case class Salary(empId: String, month: Int, amount: BigDecimal)
case class Employee(id: String, name: String, salaries: List[Salary])
Original : hasura/graphql-engine#2933 (comment)
Yes, that’s right. It never makes sense to use foldl on lists because it never has any benefit and will always leak space.
To explain why, I wrote a mini blog post explaining the difference between foldl and foldr in Haskell. To start, you have to understand that foldl and foldr are not folds “from the left” and “from the right.” Both foldl and foldr traverse the structure in the same order, which in the case of lists means left to right. The difference is the fold’s associativity.
https://ocharles.org.uk/posts/2016-01-26-transformers-free-monads-mtl-laws.html | |
https://www.reddit.com/r/haskell/comments/f995kd/pawe%C5%82_szulc_maintainable_software_architecture_in/ | |
https://www.reddit.com/r/haskell/comments/7ar5jy/free_monad_or_monad_transformer_to_manage_effects/ | |
https://mail.haskell.org/pipermail/haskell-cafe/2018-September/129992.html | |
https://mail.haskell.org/pipermail/haskell-cafe/2018-September/129988.html (thread) | |
https://www.reddit.com/r/haskell/comments/3nkv2a/why_dont_we_use_effect_handlers_as_opposed_to/ | |
https://lexi-lambda.github.io/blog/2017/04/28/lifts-for-free-making-mtl-typeclasses-derivable/ | |
https://www.reddit.com/r/haskell/comments/66pzc8/recommended_way_to_use_monad_transformers/ | |
https://making.pusher.com/3-approaches-to-monadic-api-design-in-haskell/ | |
https://www.reddit.com/r/haskell/comments/ej8fme/unordered_effects/fd00mk2/?context=1 |
Keeping a remote fork in sync | |
----------------------------- | |
git status | |
git checkout master | |
git remote -v | |
git remote add upstream https://github.com/lightbend/cloudflow.git | |
git remote -v | |
git fetch upstream | |
git pull upstream master | |
git push origin master |