One of the upcoming patterns in Haskell is enumerators. They are designed to solve the problems of producing, modifying and consuming streams of data. Enumerators are considered a bit intimidating, possibly because:There are multiple implementations, all with slightly different approaches.Some of the implementations (in my opinion) use incredibly confusing naming.The tutorials that get written usu
Enumerator Package - Yet Another Iteratee Tutorialは、Iteratee: 列挙ベースのI/Oよりは分かりやすいのですが、やっぱりよく分かりません。なぜなら、僕は使い方を知りたいのに、作り方が書いてあるからです。そこで、Enumerator ライブラリの使い方を簡単に紹介します。 登場人物 Iteratee 入力をもらって計算をします run_ で実行します IO モナドが指定されていれば、副作用を起こせます オートマトンと考えると分かりやすいです Iteratee 同士は (>>=) で合成できます Iteratee >>= Iteratee → Iteratee Enumerator Iteratee と ($$) で合成することにより、新たな Iteratee になります Enumerator $$ Iteratee → Iterate
最近ちょっと気になるiterateeを勉強したので、日本語の解説を書いてみます。と言いつつ、大部分が The Monad.Reader Issue 16 *1 からの引用です。 はじめに Iterateeと呼ばれる新たなI/Oの抽象化手法が、最近にわかに広まりつつあります。既存のI/Oが抱える問題を解決するべくOleg Kiselyovによって2008年頃に提唱されたiterateeは、新しい高性能webフレームワークsnap *2 や、hyena *3 で利用されています。また、HackagDB上にて、iterateeパッケージ*4、およびiterateeを利用できる様々なパッケージ *5 *6 *7 *8 が公開されています。 しかし、ドキュメントの少なさなどからiterateeがどういうものなのかよく分からないという人も多いようです。そういうわけなので、iterateeを易しく解説し
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く