Useful 等の公開すべきでないものが公開されている。 型が書かれていない public なメンバも多く、API に対する意識が低い。
Pk, Id, NoAssigned 等は Magic のために導入された型だが、
| trait Abs { def f(): Int } | |
| trait ConA extends Abs { def f() = 1 } | |
| trait ConB extends Abs { abstract override def f() = super.f + 1 } | |
| trait Delegate extends Abs { | |
| val abs: Abs | |
| def f() = abs.f | |
| } | |
| class A { this: Abs => |
基礎知識
読み物系
| // import scala.collection.JavaConversions._ | |
| scala> val git = new Git(new FileRepositoryBuilder().findGitDir(new java.io.File("/path/to/repos")).readEnvironment().build()) | |
| git: org.eclipse.jgit.api.Git = org.eclipse.jgit.api.Git@18ed36fb | |
| scala> git.log.addPath("foo").call.head | |
| res49: org.eclipse.jgit.revwalk.RevCommit = commit c4554d9f46de49e449242a2aa75d39874dc99498 1342332998 ----sp | |
| scala> git.log.addPath("foo").call.headOption | |
| res50: Option[org.eclipse.jgit.revwalk.RevCommit] = Some(commit d3107ef998b25d70f86f1a5d530c31c02507d59e 1342012813 ----sp) |
| check process redis-server | |
| with pidfile "/var/run/redis.pid" | |
| start program = "/etc/init.d/redis-server start" | |
| stop program = "/etc/init.d/redis-server stop" | |
| if 2 restarts within 3 cycles then timeout | |
| if totalmem > 100 Mb then alert | |
| if children > 255 for 5 cycles then stop | |
| if cpu usage > 95% for 3 cycles then restart | |
| if failed host 127.0.0.1 port 6379 then restart | |
| if 5 restarts within 5 cycles then timeout |
http://blog.tmorris.net/monads-do-not-compose/
わたしは、Scalaのメーリングリストで、「モナドは合成できない」といいました。これは正確にはどういう意味でしょうか?たぶん、以下が答えです。
まず最初に、Functor、Applicative そして Monad のインターフェイスから話をはじめましょう。
trait Functor[F[_]] {| Moved to https://github.com/tonymorris/type-class |