2013-01-01から1年間の記事一覧

各種REPLの閉じ方

irb(Ruby) exit scala :q ghci(Haskell) :q nodejs Ctrl+D coffee Ctrl+D python quit()またはCtrl+D 統一しろよと・・・

最近読んだモナドに関する記事一覧

最近読んだモナドに関する記事一覧■絶対に理解出来ないモナドチュートリアル http://konn-san.com/prog/never-understood-monad-tutorial.html■モナドとはモナドである http://fumieval.hatenablog.com/entry/2013/06/28/224439■モナドの六つの系統[Functor …

Scalaでお手軽並列処理

parallel collectionを使う。 http://docs.scala-lang.org/ja/overviews/parallel-collections/overview.html scala> val l = List(1,2,3,4,5,6,7,8,9,10) l: List[Int] = List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)scala> l.par.foreach(i => println(s"[${Threa…

ScalaでListのshuffle

scala.util.Randomを使う。 scala> scala.util.Random.shuffle(List(1,2,3,4,5)) res0: List[Int] = List(3, 5, 4, 2, 1)scala> scala.util.Random.shuffle(List(1,2,3,4,5)) res1: List[Int] = List(5, 4, 1, 2, 3)