View Multimplicit.scala
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
package multimplicit | |
sealed abstract class Multimplicit extends Product with Serializable | |
final case class ::[+H, +T <: Multimplicit](head : H, tail : T) extends Multimplicit { | |
override def toString = head match { | |
case _: ::[_, _] => "("+head+") :: "+tail.toString | |
case _ => head+" :: "+tail.toString | |
} | |
} |
View Main.scala
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
trait MyStuff { def foobar: String } | |
object Main{ | |
import scalaz._,Scalaz._ | |
import effect.IO | |
final class MyFunctorOps[F[_], A](self: F[A], F: Functor[F]){ | |
def foobar(implicit A: A =:= MyStuff): F[String] = | |
F.map(self)(_.foobar) | |
} |
View scala-specialized-bug.scala
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
package scalaz | |
import Free.Trampoline | |
object Main extends App{ | |
def fff = CTree(1,Map(2 -> CTree(3, Map()))).map(identity) | |
println(fff) | |
} |
View ImmutableArray.scala
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
object ImmutableArray { | |
def empty[A]: ImmutableArray[A] = ??? | |
} | |
class ImmutableArray[A](val self: Array[AnyRef]) extends AnyVal { | |
def foo: Unit = { | |
if(self.isEmpty) | |
ImmutableArray.empty[ImmutableArray[A]] |
View Main.scala
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
object Main1 { | |
val f = (_: List[Int]).headOption | |
val g = (_: Int) + 1 | |
val h = (_: Int) + 2 | |
val x: Int => Option[Int] = ??? |
View ApplyBuilderGenerator.scala
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
package scalaz.applybuilder | |
import java.io.File | |
import sbt._ | |
object Generator { | |
def main(args: Array[String]){ | |
val dir = args.headOption.flatMap(a => util.Try(new File(a)).toOption).getOrElse(sys.error("invalid argument" + args.mkString(" "))) | |
IO.delete(dir) |
View build.sbt
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
val printUpdatedAllModules = TaskKey[Unit]("printUpdatedAllModules") | |
printUpdatedAllModules := { | |
update.value.allModules foreach println | |
} | |
libraryDependencies += "com.typesafe.play" %% "play-json" % "2.2.2" |
View gist:9422569
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 scalaz._ | |
import \/._ | |
import Free._ | |
import scalaz.syntax.monad._ | |
object Experiment { | |
sealed trait OI[A] { | |
def map[B](f: A => B): OI[B] | |
} | |
case class Async[A](k: (A => Trampoline[Unit]) => Unit) extends OI[A] { |
View log.txt
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
java.lang.StackOverflowError | |
at scala.PartialFunction$$anonfun$runWith$1.apply(PartialFunction.scala:136) | |
at scala.PartialFunction$$anonfun$runWith$1.apply(PartialFunction.scala:135) | |
at scala.collection.immutable.Set$Set2.foreach(Set.scala:113) | |
at scala.collection.TraversableLike$class.collect(TraversableLike.scala:282) | |
at scala.collection.AbstractTraversable.collect(Traversable.scala:104) | |
at xsbt.Compat$MacroExpansionOf$.unapply(Compat.scala:125) | |
at xsbt.ExtractUsedNames.xsbt$ExtractUsedNames$$handleTreeNode$1(ExtractUsedNames.scala:86) | |
at xsbt.ExtractUsedNames$$anonfun$handleMacroExpansion$1$1.apply(ExtractUsedNames.scala:58) | |
at xsbt.ExtractUsedNames$$anonfun$handleMacroExpansion$1$1.apply(ExtractUsedNames.scala:58) |
View A.scala
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
class A[T]{ | |
def foo(t: T): Unit = {} | |
} | |
class B extends A[Y] { | |
def foo(t: X): Unit = {} | |
} | |
class X |
OlderNewer