2022-06-25 IT Development 1892 Southern Street, New York 09:00AM-07:00PM Register Target audience: Marketing, advertising and PR specialists of development companies, product and project managers responsible for developing and bringing new services and information systems to market.Entrepreneurs who create promising it services and programs.Marketing managers of companies that have considered or a
One of the simplest constructs to understand in Scalaz is the Lens. But because of its simplicity, I didn’t realize the practical usefulness of lenses in Scala until I came across a problem whose implementation was greatly improved by using them. It became clear to me that using lenses improves your codebase. The problem involved tracking and applying updates to a dataset that was represented as a
Kenji Yoshida @xuwei_k 一度公開したあともどんどん書き足したら、結構な量になったでござる(´・ω・`) http://t.co/X7ewxjzJ っていうかHaskellとあまり比較してないし関係なくなってきている・・・ 2012-02-05 04:50:38 Kenji Yoshida @xuwei_k コメントがっ「述語を量化できる論理体系では、同一性という概念をプリミティブに持たなくても 「XとYが等しいとは、全ての述語Pに対してP(X)ならばP(Y)、が成り立つこと」 という形で定義できる」 http://t.co/vKvJT0My 難しいがちょっとだけ理解が深まったような 2012-02-05 13:42:00
追記: この記事書いたあとのtwitter上での反応 ScalazとHaskellの比較記事というか疑問点をいっぱい書いたら、shelarcyさんにいっぱい教えておもらったよ! Scalaz7 では色々改善されている部分もあるけれど、まだ作りかけなので、とりあえずScalaz6.0.4で。自分のHaskellの知識が浅く、間違ってること言っている可能性大なので、なにかあればどんどん突っ込んでくださいm(_ _)m まず対応していそうなものをとにかく書きだしてみた ← 名前同じで、ほぼ同じ役割をしていると思われるもの。結構ある 無名関数の引数がカリー化されないので、Scalazのほうには、Haskellには存在しないApplicativeBuilderというものがある Scalazの場合Bifunctorというものがあるが、Haskellにbifunctorという単語がでてこない ほかにも、
Applicative Programming, Disjoint Unions, Semigroups and Non-breaking Error Handling Abstract This presentation is intended for the April 2010 meeting of the Brisbane Functional Programming Group Programming with applicative functors [ApplicativeProg] generalises monadic programming permitting more available data types with fewer operations. However, these operations are sufficient for general han
yuroyoro/scalaz-playground · GitHub タイトルの通りで、このリポジトリをcloneして、"sbt console"と入力汁。 ozaki@mbp-4 $ git clone https://github.com/yuroyoro/scalaz-playground.git [~/sandbox/.../yuroyoro/work] Cloning into 'scalaz-playground'... remote: Counting objects: 7, done. remote: Compressing objects: 100% (6/6), done. remote: Total 7 (delta 0), reused 7 (delta 0) Unpacking objects: 100% (7/7), done. ozaki@mbp-4 $ c
2011-12-17 これは Scala Advent Calendar 2011 の 17日目の記事です。 specs2 の作者であり、@etorreborre としても活発に発言を続けるシドニーの強豪 Eric Torreborre さんが書いた “The Essence of the Iterator Pattern” を翻訳しました。翻訳の公開は本人より許諾済みです。翻訳の間違い等があれば遠慮なくご指摘ください。 2011年6月24日 Eric Torreborre 著 2011年12月17日 e.e d3si9n 訳 去年読んだ論文で一番気に入ったのは “The Essence of the Iterator Pattern”(以下、EIP)だ。これを読んだ後で、今まで何年も使い続けてきたあるものに対する考えがガラリと変わった。それは、for ループだ。 この論文の中からいくつか
上級者というより、基本的には 「べつにbetter javaとして使うならば必ずしもScalaでそこまでやらなくてもいいのに、関数型の濃い話が書いてあったりする」やつです。*1というか、自分が勉強したくても一回読んだだけじゃよくわからなくて、読み直したいもののメモです。独断と偏見で選んだので、他にもあるかもしれませんがとりあえず 1. http://apocalisp.wordpress.com/ Scalazのcommiterの人です。 type level programming のシリーズ *2とかyuroyoroさんが一部訳していたりしましたね。このシリーズ順を追ってけっこう網羅的に説明されてて素晴らしいので是非読みましょう!もちろんこのシリーズ以外にも面白そうなものありますが https://twitter.com/#!/runarorama https://github.com
Scala | 19:07 | Scalaでやってみた。ただのお遊びです。 GADTs型安全なDSLとかを書くのに使えるらしい。 sealed trait Expr[T] case class I(x: Int) extends Expr[Int] case class B(x: Boolean) extends Expr[Boolean] case class Add(lhs: Expr[Int], rhs: Expr[Int]) extends Expr[Int] case class Mul(lhs: Expr[Int], rhs: Expr[Int]) extends Expr[Int] case class Eq(lhs: Expr[Int], rhs: Expr[Int]) extends Expr[Boolean] Mul(Eq(I(123), I(324)), I(456)
今月頭の更新で、Scalazをはじめましたと書きましたが、早々に仕事に忙殺されていたので、あんまり触れてませんでした。今後も忙しいので、それで終了!となるのもなんだかなぁという感じですので、合間に少しずつ遊んでいくことにします。 よって、本当に更新は遅いかもですけどね。 前回、暗黙の型変換でScalaの基本的なクラスに便利なメソッドを提供しているらしい、と書きました。これ自体はScalazの提供機能の一部ですが、まずはここからやっていこうと思います。全部の型・メソッドの組み合わせをやるつもりはなくて、Boolean、Int、List、Option、Stringあたりが使えればとりあえずはいいかなぁと。 というわけで、まずはBoolean(BooleanW)を。 BooleanW http://scalaz.github.com/scalaz/scalaz-2.9.1-6.0.2/doc/s
まずはコード1を見てください。 // コード1 def copyFile() = { val in = new FileInputStream(new File("foo.txt")) val out = new FileOutputStream(new File("bar.txt")) val buf = new Array[Byte](1024) var len = 0; while ({ len = in.read(buf); len != -1 }) { out.write(buf, 0, len) } in.close() out.close() } なんのへんてつもないファイルコピー(foo.txt -> bar.txt)のコードです。 別にこれでいいっちゃいいのですが、こういったコードの場合、closeを忘れたら残念なことが起こり得ます。 using という訳でさんざん既出で
A programmer's blog - will deal with everything that relates to a programmer. Occasionally, it will contain some humour, some politics and some sport news. Monads don't compose .. and hence Monad Transformers. A monad transformer maps monads to monads. It lets you transform a monad with additional computational effects. Stated simply, if you have a monadic computation in place you can enrich it in
下記で取り上げられているネタについてメモを残す。 Scala の Either についての考察 - scalaとか・・・ Scala勉強会第53回 (EitherやScalazのValidationについて) - Togetter Either と Scalaz Either は flatMap メソッドを持たないので for 式では使えない。for 式内で Right で処理を進めたいなら right メソッドで、Left で処理を進めたいなら left メソッドで *Projection を取得する必要がある。 def r(n: Int): Either[String, Int] = Right(n) for { x <- r(1).right; y <- r(x).right } yield x+y とはいえ、多くの場合 Right で処理を進めたい場合が多く、Left で処理を進め
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く