This file has been truncated, but you can view the full file.
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
miles@tarski:perf_tester (topic/miles-byname-implicits)% java -jar target/scala-2.12/perf_tester-assembly-0.1.jar -s /home/miles/projects/scala -r results -a corpus/scala-library -c miles-byname-implicits --user miles -i 50 -p 3 | |
Output logging to /home/miles/projects/perf_tester/results/miles/miles-byname-implicits | |
ALL | |
Run Name Cycle samples Wall time (ms) All Wall time (ms) CPU(ms) Idle time (ms) Allocated(MBs) | |
pre-pr 1 50 9,332.00 [-10.92% +203.33%] 9,332.00 [-10.92% +203.33%] 9,188.06 [-10.64% +196.26%] 0.00 [ NaN% NaN%] 2,743.61 [-0.38% +6.58%] | |
pre-pr 2 50 9,088.94 [-10.42% +192.67%] 9,088.94 [-10.42% +192.67%] 8,959.18 [-10.03% +185.47%] 0.00 [ NaN% NaN%] 2,745.65 [-0.51% +6.81%] | |
pre-pr 3 50 9,176.00 [-9.87% +199.00%] 9,176.00 [-9.87% |
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
----------------------------- | |
ALL | |
Run Name Cycle samples Wall time (ms) All Wall time (ms) CPU(ms) Idle time (ms) Allocated(MBs) | |
pre-pr 1 30 9,830.23 [-13.87% +183.84%] 9,830.23 [-13.87% +183.84%] 9,644.07 [-13.42% +178.31%] 0.00 [ NaN% NaN%] 2,775.16 [-0.65% +6.12%] | |
pr 1 30 9,818.50 [-14.81% +186.90%] 9,818.50 [-14.81% +186.90%] 9,642.10 [-14.13% +181.26%] 0.00 [ NaN% NaN%] 2,762.69 [-0.67% +7.13%] | |
jason-feedback 1 30 9,805.13 [-14.34% +184.80%] 9,805.13 [-14.34% +184.80%] 9,617.57 [-13.61% +179.12%] 0.00 [ NaN% NaN%] 2,760.19 [-0.62% +6.94%] | |
----------------------------- | |
ALL | |
Run Name Cycle samples Wall time (ms) All Wall time (ms) CPU(ms) |
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
// Current Scala 2 | |
trait Concat[A, B] { | |
type Result | |
def apply(a: A, b: B): Result | |
} | |
object Concat { | |
def apply[A, B](a: A, b: B)(implicit cab: Concat[A, B]): cab.Result = cab(a, b) | |
implicit def hnil[B]: Concat[HNil, B] { type Result = B } = new Concat[HNil, B] { |
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 scala.language.{ higherKinds, implicitConversions } | |
object Defns { | |
type Id[T] = T | |
type ApplyTo[T] = { type λ[F[_]] = F[T] } | |
type Const1[T] = { type λ[F[_]] = T } | |
// Natural transform | |
trait ~>[F[_], G[_]] { | |
def apply[T](ft: F[T]): G[T] |
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
// Used as a term `the[T]` yields the unique implicit value of type `T` in the current | |
// implicit scope, if any. It is a compile time error if there is no such value. Its | |
// primary advantage over `Predef.implicitly` is that it will preserve any refinement that | |
// the implicit definition has, resulting in more precisely typed, and hence often more | |
// useful, values, | |
scala> trait Foo { type T ; val t: T } | |
defined trait Foo | |
scala> implicit val intFoo: Foo { type T = Int } = new Foo { type T = Int ; val t = 23 } |
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
// What output does this yield? What should it? (try with either 2.12.x or 2.13.x) | |
// (spoiler: https://github.com/scala/bug/issues/10788) | |
object Test { | |
class Box[T](t: T) { | |
def foo: T = { | |
println("effect") | |
t | |
} | |
} |
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
Welcome to Scala version 2.10.2 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_21). | |
Type in expressions to have them evaluated. | |
Type :help for more information. | |
scala> class Prefix { class Dep { type P = Prefix.this.type } } | |
defined class Prefix | |
scala> val (p1, p2) = (new Prefix, new Prefix) | |
p1: Prefix = Prefix@2212c414 | |
p2: Prefix = Prefix@7e070e85 |
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
### Keybase proof | |
I hereby claim: | |
* I am milessabin on github. | |
* I am milessabin (https://keybase.io/milessabin) on keybase. | |
* I have a public key whose fingerprint is 87D4 DCA4 07A5 556C 0BAD D01F 420D 4BEE 9FA4 7A44 | |
To claim this, I am signing this object: |
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
miles@frege:~$ ./shapeless.sh | |
Loading... | |
Welcome to the Ammonite Repl 0.5.2 | |
(Scala 2.11.7 Java 1.8.0_51) | |
@ val l = 23 :: "foo" :: true :: HNil | |
l: Int :: String :: Boolean :: HNil = ::(23, ::("foo", ::(true, HNil))) | |
@ |
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 scala.language.higherKinds | |
class Cartesian[F[_]] { | |
trait Arbitrary1 | |
trait Arbitrary2 | |
implicit val fa1: F[Arbitrary1] = null.asInstanceOf | |
implicit val fa2: F[Arbitrary2] = null.asInstanceOf | |
class QED | |
implicit def proof(implicit fa12: F[(Arbitrary1, Arbitrary2)]): QED = null | |
} |