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.
// 1. Accessing algebras through Type Class(the Fake Type Class Jhon mentioned in his TF dead talk) | |
// instance for F | |
class Service { | |
def fetchUserInfo[F[_]: Concurrent: UserAlg: OrderAlg](id: UserId): F[UserInfo] = ??? | |
} | |
// 2. Accessing algebras through interpreters dependencies |
object Main extends App { | |
AvoidLosingGenericType.run() | |
AvoidMatchingOnGenericTypeParams.run() | |
TypeableExample.run() | |
TypeTagExample.run() | |
} | |
class Funky[A, B](val foo: A, val bar: B) { | |
override def toString: String = s"Funky($foo, $bar)" | |
} |
object game { | |
case class Lens[S, A](set: A => S => S, get: S => A) { self => | |
def >>> [B](that: Lens[A, B]): Lens[S, B] = | |
Lens[S, B]( | |
set = (b: B) => (s: S) => self.set(that.set(b)(self.get(s)))(s), | |
get = (s: S) => that.get(self.get(s)) | |
) | |
} | |
case class Prism[S, A](set: A => S, get: S => Option[A]) { self => |
#!/usr/bin/env zsh | |
# | |
# Garrett Zsh Theme for Prezto | |
# Created with modified code by Chauncey Garrett - @chauncey_io | |
# | |
# http://chauncey.io/projects/zsh-prompt-garrett/ | |
# | |
# A prompt with the information you need the moment you need it. | |
# | |
# This prompt has the following features: |
stack --no-system-ghc --install-ghc build ghc-mod hlint stylish-haskell |
# open/edit the GHC compiler seetings | |
code $(stack ghc -- --print-libdir)/settings | |
# searh process using the port | |
lsof -i tcp:<port> | |
# kill a process | |
sudo kill -9 <pid> | |
# list process |
cd
into the uncompresed harvest-lint
directoryharvest-projects.yaml
file following instructions from hererun-linter
file and replace the placeholders in the following section with real informationexport HARVEST_USERNAME=<account_username>
export HARVEST_PASSWORD=
touch ~/.gradle/gradle.properties && echo "org.gradle.daemon=true" >> ~/.gradle/gradle.properties |