I hereby claim:
- I am noelmarkham on github.
- I am noel (https://keybase.io/noel) on keybase.
- I have a public key whose fingerprint is 89A2 B6E9 B309 3F3A 752B 705A 2660 0E7B 872A 52AB
To claim this, I am signing this object:
| object FlakyFunctionTest { | |
| import scalaz._ | |
| import Scalaz._ | |
| var state = false | |
| val function: Unit => String = scalaz.Memo.immutableHashMapMemo { _ => | |
| println(s"We received a call") |
| scala> :paste | |
| // Entering paste mode (ctrl-D to finish) | |
| import org.scalacheck.Prop.forAll | |
| import org.scalacheck.Properties | |
| import shapeless.contrib.scalacheck._ | |
| case class WebServerConfig(hostname: String, port: Int) | |
| case class ApplicationConfig(webServer: WebServerConfig) |
| // Given a case class where the first two elements have the same type, swap those values: | |
| def swap[T, U <: HList, H1, H2, T1 <: HList, T2 <: HList](v: T)( | |
| implicit // proofs: | |
| // Case class T can be represented by U | |
| // (U is an output, must be used as an output before using it as an input in the proofs below) | |
| gen: Generic.Aux[T, U], | |
| // U is composed of H1 :: T1 | |
| isc1: IsHCons.Aux[U, H1, T1], |
| scala> import org.scalacheck._ | |
| import org.scalacheck._ | |
| scala> val generatedFunc = Gen.resultOf[String => Int, String => Int](identity).sample.get | |
| generatedFunc: String => Int = <function1> | |
| scala> generatedFunc("hello") == generatedFunc("goodbye") | |
| res0: Boolean = true |
| import shapeless._ | |
| import shapeless.ops.hlist.IsHCons | |
| object ShapelessDojo { | |
| def addOneToCaseClass[C, H <: HList, E, T <: HList] | |
| (c: C) | |
| (implicit gen: Generic.Aux[C, H], | |
| h: IsHCons.Aux[H, E, T], | |
| ev: E =:= Int, |
I hereby claim:
To claim this, I am signing this object:
| import... | What it imports |
|---|---|
cats.std.type |
Typeclass instances for standard library type (think List, Option) |
cats.syntax.type |
“Enhanced” methods for type (.toRightXor etc) |
cats.data.type |
Imports a type not part of the standard library (think Xor, Kleisli) and its typeclass instances |
| package nm | |
| import cats._ | |
| import cats.implicits._ | |
| import cats.data.WriterT | |
| object Mocking { | |