Skip to content

Instantly share code, notes, and snippets.

import cats._
object Moneys:
opaque type Money = Double
object Money:
def apply(d: Double): Money = d
given Monoid[Money] = {
import cats.implicits._
@choplin
choplin / .env
Created January 12, 2022 12:43
Script to stamp in on Jobcan
EMAIL={your email address}
PASSWORD={your password}
import SwiftUI
import HealthKit
struct ContentView: View {
@State var labelText = "Get Data"
@State var flag = false
let healthStore = HKHealthStore()
let allTypes = Set([
HKSeriesType.heartbeat(),
@choplin
choplin / test.json
Created August 24, 2020 04:37
test json
{}
case class User(id: Int, name: String, item: Seq[Item])
case class Item(id: Int, name: String)
trait UserRepository[F[_]] {
def find(id: Int): OptionT[F, User]
def store(user: User): F[Unit]
}
trait ItemRepository[F[_]] {
import wvlet.airframe._
import wvlet.airspec._
case class Foo[A](a: A)
trait ParametricService[A] {
private val alg = bind[Foo[A]]
}
trait ConcreteService {
import wvlet.airframe._
import wvlet.airspec._
case class Wrap[A](a: A)
trait Algebra[M[_]] {
def f: M[Int]
}
trait Service[A[_]] {
~/tmp
❯ git clone https://github.com/choplin/airframe-sealed-error-example
Cloning into 'airframe-sealed-error-example'...
remote: Enumerating objects: 12, done.
remote: Counting objects: 100% (12/12), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 12 (delta 0), reused 12 (delta 0), pack-reused 0
Unpacking objects: 100% (12/12), 1015 bytes | 84.00 KiB/s, done.
~/tmp
package example
import wvlet.airframe._
sealed trait Adt
object Adt {
object Foo extends Adt
object Bar extends Adt
}
alias docker-chrome="/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome $(docker-machine ip default)"