Category:
Combo: Talk & Workshop
Target:
Intermediate - Expected knowledge of basic Scala or Haskell syntax
(examples will be contrasted in both).
Language:
user=> (defn adder [x y] (+ x y)) | |
(defn adder [x y] (+ x y)) | |
#'user/adder | |
user=> (partial adder) | |
(partial adder) | |
#<user$adder user$adder@2c40072a> | |
user=> (def adderx (partial adder)) | |
(def adderx (partial adder)) | |
#'user/adderx | |
user=> (adderx 1) |
;; repl session | |
(use 'lens) | |
(defrecord Address [street city postcode]) | |
(defrecord Person [name age address]) | |
(defrecord User [uid username identity password]) | |
(def -postcode (mklens :postcode)) | |
(def -city (mklens :city)) |
import argonaut._, Argonaut._ | |
class Example(val s: String, val i: Int) | |
object Example { | |
implicit def ExampleEncodeJson: EncodeJson[Example] = | |
EncodeJson(example => Json( | |
"s" := example.s, | |
"i" := example.i)) |
scalacOptions ++= Seq("-deprecation", "-unchecked", "-optimise", "-Yinline-warnings", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:postfixOps") |
Host B | |
ProxyCommand ssh A nc -w 360 B 22 | |
Host C | |
ProxyCommand ssh B nc -w 360 C 22 | |
sealed trait Accent[A] | |
final case class Zed(n: Int) extends Accent[Int] | |
final case class Zee(s: String) extends Accent[String] | |
object Example { | |
def twice[A](accent: Accent[A]): Accent[A] = accent match { | |
case Zed(n) => Zed(n + n) | |
case Zee(s) => Zee(s + s) | |
} |
Category:
Combo: Talk & Workshop
Target:
Intermediate - Expected knowledge of basic Scala or Haskell syntax
(examples will be contrasted in both).
Language:
import scalaz._, Scalaz._ | |
case class ListT[F[+_], +A](stepListT: F[TStep[A, ListT[F, A]]]) { | |
def ++[AA >: A](other: ListT[F, AA])(implicit F: Monad[F]): ListT[F, AA] = ListT(for { | |
s <- stepListT | |
r <- s match { | |
case TNil() => | |
other.stepListT | |
case TCons(a, x) => | |
TStep.cons(a, x ++ other).pure[F] |
So what I understand to be your questions:
A way to step through understanding this problem:
This is a basically what we are running into on https://github.com/argonaut-io/argonaut/tree/series/6.0.x:
[23:22] [ seanparsons ] With a fresh sbt I get this from 2.9.3: [success] Total time: 78 s, completed 21-Apr-2014 14:20:53
[23:25] [ seanparsons ] With a fresh sbt I get this from 2.10.4: [success] Total time: 60 s, completed 21-Apr-2014 14:22:57
[23:25] [ seanparsons ] But in the cross build that second one was: [success] Total time: 332 s, completed 21-Apr-2014 14:01:57
And it seems to be exponential. We are building for 4 platforms (2.9.2, 2.9.3, 2.10.4, 2.11.0). Running ./sbt "; clean ; +test"
can take hours.