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
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
val buildFiles = SettingKey[Map[File, Seq[Byte]]]("build-files") | |
buildFiles := getBuildFiles((baseDirectory in ThisBuild).value) | |
def getBuildFiles(base: File) = | |
((base * "*.sbt") +++ ((base / "project") ** ("*.scala" | "*.sbt"))).get.map{ | |
f => f -> collection.mutable.WrappedArray.make[Byte](Hash(f)) | |
}.toMap | |
def changed(base: File, files: Map[File, Seq[Byte]]): Boolean = |
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 |
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) | |
} |
- JRebelを利用すると、アプリケーションの再起動なしで実行中のアプリケーションに加えた変更を即座に反映することができます(ホットリローディング)。まるでPHPのようにサクサク書けるッ!
- Scala開発者にはライセンスが$0で提供されます。Javaで利用する場合は購入してね☆彡
以下がインストールされているものとする。
Original: "Callbacks are imperative, promises are functional: Node's biggest missed opportunity" by James Coglan
Translated by Yuta Okamoto (@okapies)
- 訳者は JavaScript や Node.js に関する専門知識がほとんどありません。識者のツッコミをお待ちしております。「◯◯が分からない」等も歓迎です。
- 元記事から構成を一部変更しています。また、関数型プログラミングに関する記述のうち、議論の骨子に絡まないものは省略しています。
NewerOlder