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 IntepreterFix { | |
| import scala.tools.nsc._ | |
| import Interpreter._ | |
| def break(args: DebugParam[_]*): Unit = { | |
| val intLoop = new InterpreterLoop | |
| intLoop.settings = { | |
| val s = new Settings(Console.println) | |
| // need to pass this explicitly to the settings for Scalac. | |
| // See: http://old.nabble.com/-scala--recent-changes-in-2.8-nightly-classpath-management-td26233977.html |
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
| // Sorry Predef, we want '+' back! | |
| import Predef.{any2stringadd => _, _} | |
| object test { | |
| { | |
| trait MyNumeric[T] extends Ordering[T] { | |
| def plus(x: T, y: T): T | |
| // |
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
| trait ==>>[-A, +B] extends (A => B) { | |
| self => | |
| def apply(a: A): B | |
| def map[C](f: B => C) = new (A ==>> C) { | |
| def apply(a: A) = f(self.apply(a)) | |
| } | |
| def comap[C](f: C => A) = new (C ==>> B) { | |
| def apply(c: C) = self.apply(f(c)) |
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
| // Splitter to apply two pattern matches on the same scrutinee. | |
| case object && { | |
| def unapply[A](a: A) = Some((a, a)) | |
| } | |
| // Extractor object matching first character. | |
| object StartsWith { | |
| def unapply(s: String) = s.headOption | |
| } |
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
| //[[syntax trees at end of jvm]]// Scala source: conjunction.scala | |
| package <empty> { | |
| final class test extends java.lang.Object with ScalaObject { | |
| final <synthetic> private[this] def gd1$1(x$1: Char): Boolean = scala.this.Predef.augmentString("aeiou").contains(scala.Char.box(x$1)); | |
| def this(): object test = { | |
| test.super.this(); | |
| { | |
| { | |
| var temp2: java.lang.String("foo") = "foo"; | |
| { |
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 test { | |
| trait Bar[M[_]] | |
| def baz[M[_] : Bar, A](m: M[A]) = 0 | |
| implicit object ListBar extends Bar[List] | |
| baz(List(1)) | |
| type EitherIntX[X] = Either[Int, X] | |
| implicit object EitherIntXBar extends Bar[EitherIntX] | |
| val e: Either[Int, String] = Left(1) | |
| //baz(e) |
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
| class PF[A] { | |
| def apply[B](pf: PartialFunction[A, B]) = pf | |
| } | |
| def pf[A] = new PF[A] | |
| pf[Any] { case 5 => true } | |
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
| typed1():4030, Typers$Typer {scala.tools.nsc.typechecker} | |
| this = {scala.tools.nsc.typechecker.Typers$NormalTyper@2012} | |
| tree$4 = {scala.reflect.generic.Trees$Select@2128}"List[Option[Int]]().sequence" | |
| mode$2 = 1 | |
| pt$2 = {scala.tools.nsc.symtab.Types$TypeRef$rawTypeRef$1@2137}"Option[List[Int]]" | |
| sym$2 = {scala.tools.nsc.symtab.Symbols$NoSymbol$@2030}"<none>" | |
| temp817 = {scala.reflect.generic.Trees$Select@2128}"List[Option[Int]]().sequence" | |
| temp818 = {scala.reflect.generic.Trees$Apply@2140}"List[Option[Int]]()" | |
| temp819 = {scala.tools.nsc.symtab.Names$TermName@2113}"sequence" | |
| temp820 = null |
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
| import Predef.{doubleWrapper => _, _} | |
| object test { | |
| 1.0: AnyRef | |
| } |
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
| > ++ 2.8.0.Beta1 | |
| Getting Scala 2.8.0.Beta1 ... | |
| :: retrieving :: org.scala-tools.sbt#boot-scala | |
| confs: [default] | |
| 2 artifacts copied, 0 already retrieved (12552kB/1137ms) | |
| [0m[[0minfo[0m] [0mBuilding project bisect 1.0 against Scala 2.8.0.Beta1[0m | |
| [0m[[0minfo[0m] [0m using ScalazProject with sbt 0.7.1 and Scala 2.7.7[0m | |
| > ch check-bytecode-action | |
| [0m[[0minfo[0m] [34m[0m |