- Welcome to @sjrd who joins us
- @odersky, @jsuereth, @dickwall and @SethTisue are all there
- @dickwall gloats about his holiday
- @Eran has the flu
- @heathermiller is "otherwise engaged"
This file contains hidden or 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
/* | |
* here is a cool thing @Astrac did | |
* | |
* lifts `A => F[B]` to `F[A => B]`, where `F` has a Comonad and an applicative | |
*/ | |
def lift[F[_], A, B](f: A => F[B])(implicit cm: Comonad[F], ap: Applicative[F]): F[A => B] = ap.pure(a => f(a).extract) |
This file contains hidden or 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
final case class Cofree[F[_], A](head: A, tail: F[Cofree[F,A]]) | |
val fibs: Cofree[Eval, Int] = { | |
def unfold(p1: Int, p2: Int): Cofree[Eval, Int] = | |
Cofree(p1 + p2, Eval.later(unfold(p2, p1 + p2))) | |
unfold(0, 1) | |
} | |
scala> fibs.head |
This file contains hidden or 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
[info] Loading global plugins from /Users/hamishdickson/.sbt/0.13/plugins | |
[info] Updating {file:/Users/hamishdickson/.sbt/0.13/plugins/}global-plugins... | |
[info] Resolving org.fusesource.jansi#jansi;1.4 ... | |
[info] Done updating. | |
[info] Set current project to catsSandbox (in build file:/Users/hamishdickson/Workspace/catsSandbox/) | |
[info] Starting scala interpreter... | |
[info] | |
Welcome to Scala 2.12.1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_101). | |
Type in expressions for evaluation. Or try :help. |
This file contains hidden or 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
scala> trait Foo[T] { | |
| type A | |
| def woozle(a: T): A | |
| } | |
defined trait Foo | |
scala> implicit val bar = new Foo[Int] { | |
| type A = String | |
| def woozle(a: Int): A = s"hamish has had $a cakes today" | |
| } |
This file contains hidden or 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
scala> trait Foo[T] { | |
| type A | |
| def woozle(a: T): A | |
| } | |
defined trait Foo | |
scala> implicit val bar = new Foo[Int] { | |
| type A = String | |
| def woozle(a: Int): A = s"num: $a" | |
| } |
This file contains hidden or 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
$ ghci -XNoMonomorphismRestriction | |
GHCi, version 7.10.2: http://www.haskell.org/ghc/ :? for help | |
Prelude> |
This file contains hidden or 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
public Test { | |
public void testMyThing() { | |
MyClass myClass = new MyClass(); | |
Method method = myClass.getClass().getDeclaredMethod("setId", ArgTypeIfAny.class); | |
privateStringMethod.setAccessible(true); | |
method.invoke(myClass, args); | |
} |
This file contains hidden or 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
select(FruitTable.name, FruitTable.juiciness) | |
.from(FruitTable) | |
.where(FruitTable.juiciness >= 8) | |
.orderBy(FruitTable.juiciness.desc) | |
.fetchAll(fruitExtractor) |
This file contains hidden or 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
object DeleteExamples extends App with DatabaseExample { | |
InsertExamples.insertAll | |
val deleteStatement = | |
delete | |
.from(FruitTable) | |
.where(FruitTable.name === """Banana""") | |
// try again to run the delete statement in a transaction | |
database.withTransaction { |