EXPERIMENTALな位置づけです。
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 httpz._, native._ | |
object Main { | |
final case class Repo(owner: String, name: String) | |
val repositories = ( | |
Repo("slick", "slick") :: | |
Repo("mauricio", "postgresql-async") :: | |
Repo("squeryl", "squeryl") :: |
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.annotation.tailrec | |
import scalaz._ | |
import scalaz.Leibniz.=== | |
object Ideal { | |
private final case class Pure[F[_], A](a: A) extends Ideal[F, A] | |
private final case class Suspend[F[_], A](fa: F[A]) extends Ideal[F, A] | |
private sealed abstract case class Gosub[F[_], B]() extends Ideal[F, B] { | |
type C | |
val a: () => Ideal[F, C] |
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 HApply[F[_[_]]] extends HFunctor[F] { | |
def apply2[A1[_], A2[_], Z[_]](a1: F[A1], a2: F[A2])(f: ({type l[a] = (A1[a], A2[a])})#l ~> Z): F[Z] | |
def apply3[A1[_], A2[_], A3[_], Z[_]](a1: F[A1], a2: F[A2], a3: F[A3])(f: ({type l[a] = (A1[a], A2[a], A3[a])})#l ~> Z): F[Z] = | |
apply2[({type l[a] = (A1[a], A2[a])})#l, A3, Z](tuple2(a1, a2), a3)( | |
new (({type l[a] = ((A1[a], A2[a]), A3[a])})#l ~> Z){ | |
def apply[a](fa: ((A1[a], A2[a]), A3[a])) = | |
f((fa._1._1, fa._1._2, fa._2)) | |
} | |
) |
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._, Scalaz._ | |
object MaxValue extends App { | |
val a = Map(1 -> 10, 2 -> 5) | |
val b = Map(2 -> 10, 3 -> 7) | |
val c = a.mapValues(Tags.MaxVal) |+| b.mapValues(Tags.MaxVal) | |
(c: Map[Int, Int]) assert_=== Map(1 -> 10, 2 -> 10, 3 -> 7) | |
} |
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
{-# LANGUAGE GADTs #-} | |
module Main where | |
import Control.Monad | |
import Control.Monad.Operational.Simple | |
import Prelude hiding (putChar, getChar) | |
import qualified System.IO as IO | |
import Test.QuickCheck |
Java8対応の1.3がリリースされそうな様子がないため、1.2.xブランチにJava8対応コミットを適用して利用する。
-
GitHubサイト上で PlayFramework1リポジトリ をforkする
-
タグ 1.2.5.4 をチェックアウトして新しいブランチ 1.2.5.4-java8 を生成する
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
public class PhantomBuilderSample { | |
public static class Data { | |
private final int field1; | |
private final int field2; | |
private final int field3; | |
private final int optField1; | |
private final int optField2; | |
private Data(Builder<OK, OK, OK> builder) { |
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] |
OlderNewer