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 shapeless._ | |
import shapeless.ops.hlist._ | |
import scala.util.Try | |
object validation { | |
trait Violation { | |
def message: String | |
} | |
abstract class SimpleViolation(val message: String) extends Violation |
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
sealed trait Interact[A] | |
case class Ask(prompt: String) | |
extends Interact[String] | |
case class Tell(msg: String) | |
extends Interact[Unit] | |
trait Monad[M[_]] { | |
def pure[A](a: A): M[A] |
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 test2 | |
import scala.language.higherKinds | |
trait T1[A] | |
trait T2[A] | |
trait T3[A] | |
trait TypeList | |
trait Nil extends TypeList |
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 javax.servlet.http.HttpServletRequest | |
class FakeHttpServletRequest extends HttpServletRequest { | |
// Members declared in javax.servlet.http.HttpServletRequest | |
def authenticate(x$1: javax.servlet.http.HttpServletResponse): Boolean = ??? | |
def getAuthType(): String = ??? | |
def getContextPath(): String = "/" | |
def getCookies(): Array[javax.servlet.http.Cookie] = Array.empty | |
def getDateHeader(x$1: String): Long = ??? | |
def getHeader(x$1: String): String = ??? |
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 experiment | |
import scala.concurrent.ExecutionContext | |
import scala.concurrent.Future | |
import scala.language.higherKinds | |
import scala.language.implicitConversions | |
import scala.reflect.ClassTag | |
import akka.actor.Actor | |
import akka.actor.ActorRef |
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
internalDependencyClasspath in Compile in `play-cms-testing` += | |
interProjectDependency(`play-cms`, Compile).value | |
internalDependencyClasspath in Test in `play-cms` += | |
interProjectDependency(`play-cms-testing`, Compile).value | |
def interProjectDependency(project:Project, configuration:Configuration) = Def.task { | |
Attributed.blank( | |
(classDirectory in configuration in project) | |
.map(identity) // convert the setting into a task |
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 Co[F[_], G[_]] { | |
case class Product[A](value: Either[F[A], G[A]]) | |
} | |
trait ProgramType[F[_]] | |
object ProgramType { | |
def apply[T](implicit to: ToParameterized[T]): ProgramType[to.Out] = ??? | |
} | |
trait ToParameterized[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
package p { | |
object Test { | |
import construction.Monadic | |
import execution.Bimonad | |
def main(args: Array[String]): Unit = { | |
val expression = Monadic[List](10) flatMap (1 to _ toList) coflatMap (_.sum) |
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 Party { | |
type Chocolate = Char | |
type Sticker = Any | |
def complain(c: Chocolate) = abort(s"You should have asked me if I wanted `$c`") | |
sealed trait Girl { | |
def willYouEat(c: Chocolate): VagueAnswer | |
def eat(c: Chocolate): (Rating, Girl) |
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
_ = magic | |
Option[A] = Some[A] | None | |
/* | |
O: Objects | |
A: Arrows | |
*/ | |
O_00 = { _, X } | |
O_00 = { _ -> X } |
OlderNewer