This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cats._ | |
object Moneys: | |
opaque type Money = Double | |
object Money: | |
def apply(d: Double): Money = d | |
given Monoid[Money] = { | |
import cats.implicits._ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EMAIL={your email address} | |
PASSWORD={your password} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
import HealthKit | |
struct ContentView: View { | |
@State var labelText = "Get Data" | |
@State var flag = false | |
let healthStore = HKHealthStore() | |
let allTypes = Set([ | |
HKSeriesType.heartbeat(), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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[_]] { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import wvlet.airframe._ | |
import wvlet.airspec._ | |
case class Foo[A](a: A) | |
trait ParametricService[A] { | |
private val alg = bind[Foo[A]] | |
} | |
trait ConcreteService { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import wvlet.airframe._ | |
import wvlet.airspec._ | |
case class Wrap[A](a: A) | |
trait Algebra[M[_]] { | |
def f: M[Int] | |
} | |
trait Service[A[_]] { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package example | |
import wvlet.airframe._ | |
sealed trait Adt | |
object Adt { | |
object Foo extends Adt | |
object Bar extends Adt | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias docker-chrome="/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome $(docker-machine ip default)" |
NewerOlder