About CiteSeerX is an evolving scientific literature digital library and search engine. @2007-2024 The Pennsylvania State University
この記事は、Monad でつまづいた Haskeller のための Monad 再入門です。 Monadとは何ですか? Monad とは、単なる型クラスの一つです。難しいという風評もありますが、それ以上でもそれ以下でもありません。 この型クラスのメソッドは、return と >>= です。 class Monad m where (>>=) :: m a -> (a -> m b) -> m b return :: a -> m a つまり、以下を満たす型の集合が Monad です。 m a で表現できるように一つの型変数を格納するコンテナ型 >>= と return を実装 return は新しいコンテナを作り、>>= は二つのコンテナを合成します。 Monad のインスタンスは失敗系と状態系に大別できます。以下に代表的なインスタンスを示します。 失敗系: Maybe、[] (リスト)
状態をモナドで実現する方法を考えます。 リスト 例は簡単な方がいいので、データ構造として Lisp 風のリストを定義しましょう。 data List a = Nil | Cons a (List a) deriving Show リストは、こんな風に表せます。 Cons "c" (Cons "b" (Cons "a" Nil)) Lisp 風の cons も定義してみましょう。 cons :: a -> List a -> List a cons x xs = Cons x xs cons "c" $ cons "b" $ cons "a" Nil → Cons "c" (Cons "b" (Cons "a" Nil)) 状態を持つリスト さて、この Lisp 風のリストに、要素の数を覚えさせておきたいとしましょう。もちろん、数えれば分りますが、数えなくても一瞬で分るようにしたいのです。
*fakeclip* is a Vim plugin to provide a pseudo |clipboard| register for several versions of Vim without |+clipboard| support, especially for non-GUI version of Vim on the following platforms: - Cygwin - Mac OS X - X Window System (by xclip <http://sourceforge.net/projects/xclip/>) fakeclip also provides a pseudo register to access a "paste buffer" if one of the following applications is available:
追記しました (2011-08-08T16:57:50Z) 割と弊社では MySQL の event scheduler を使ってみたり、ストアドプロシージャ、トリガーなど積極的に使っています。 今回はストアドプロシージャを書く上で、変数を色々使うのですが備忘録としてメモっておきます。 MySQL における変数には幾つか種類があります。 システム変数 (c.f. @@version) ユーザー変数 (c.f. @var_name) ローカル変数 (c.f. DECLARE var_name INT, ストアドプロシージャ内で使える) これら変数の特徴は下記です。(MySQL 5.1.50 で確認) -- システム変数 ユーザー変数 ローカル変数 スコープ GLOBAL *1 SESSION LOCAL 型 なし なし あり 宣言 なし なし あり 設定 SET GLOBAL / SET S
Hello. We're proud to announce the first public release of the jitviewer. As of now, jitviewer is a slightly internal tool that helps understanding how your Python source code is compiled by the PyPy's JIT all the way down to machine code. To install it, you need a very recent version of PyPy (newer than 9th of August), for example one of the nightly builds: install pip and distribute either by cr
In this quick tutorial, Marakana Python instructor, Simeon Franklin, is going to show you how you can debug your Python applications using the Python debugger, pdb. Simeon will start off with a quick intro to pdb: what it is, when to use it, and how to launch pdb. Then he'll jump into a demo of pdb in action. Want to learn more about Python? Check out some of Simeon's upcoming Python training cour
こちらとこちらのエントリーの続き memcached 1.4.6でmixiの障害の原因となったaccept_new_connsがスレッドセーフじゃない件は修正されているはずだったのですが、検証したところ別のスレッド競合による不具合が発生し、Bugは全て解消されてはいませんでした。 この件についてmixiたんぽぽGの森本さんと調査していたところ、memcachedのcommiterにtwitter上で補足され、つたない英語で報告をあげていたら1.4.7-rc1で修正されたのでその報告。 memcached 1.4.6での不具合再現方法 まず、1.4.6で不具合を再現させる方法について。mixiのエンジニアブログと同じように、memcachedは次のオプションで起動し、 $ ./memcached -U 0 -u nobody -p 11222 -t 4 -m 16000 -C -c 1000
PHP よりは Xslate が好きな加藤和良です。プログラミング言語のなかでは Scala が好き です。 さて今回も いまからでも間に合う開発者テスト Buildbot で継続的インテグレーション Jenkins はじめました + ほか3つ に引き続き開発者テストの話をします。 テストをリモートで実行したい 最近になって何度か「このブランチのテストを Jenkins で一度だけ実行してもらえませんか?」という相談をうけました。最初はなにか勘違いをされているのかと思い「いや Jenkins がやっている仕事はテストを実行しているだけで、テストは手元でも実行できますよ」と説明していたのですが、話を聞いていると「テストの実行が遅いので Jenkins のホストを使いたい」という意図だということに気づきました。 以前に何度か説明している通り mixi における「ブランチ」は開発版です。安定版に
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く