タグ

関連タグで絞り込む (0)

  • 関連タグはありません

タグの絞り込みを解除

haskellとenumeratorに関するmasterqのブックマーク (4)

  • Why iteratees are hard to understand : ezyang's blog

    January 4, 2012There are two primary reasons why the low-level implementations of iteratees, enumerators and enumeratees tend to be hard to understand: purely functional implementation and inversion of control. The strangeness of these features is further exacerbated by the fact that users are encouraged to think of iteratees as sinks, enumerators as sources, and enumeratees as transformers. This

    masterq
    masterq 2012/01/05
    読めヲレ。
  • iterateeとは何か、何が良いのか - www.kotha.netの裏

    iterateeって良く聞くけど何が良いの、と思ってるHaskellユーザのためのメモ。iterateeについては既に日語の紹介が複数あるが、この記事では実装の詳細に立ち入らず、何が嬉しくてあんな奇妙なインタフェースになっているかについてだけ説明する。具体的なライブラリは使わず、出てくるHaskell風のコードは全て疑似コード。 データ源と処理の分離 iterateeは何をするものかを一言で言うと、データを取得しながら回すループを簡単に書くためのものだ。典型的には、ファイルやソケットからデータを受け取り、それを加工して、画面に出力したり統計を取ったりする。これを素朴に書くと、readやrecvをして、EOFを判定し、加工し、最終的な処理をするまでを一つのループ内で行うことになる。ループが大きくなってくるとこれは嫌なので、ループを分解して、データの取得、加工、最終処理をそれぞれ別々に書いて

    iterateeとは何か、何が良いのか - www.kotha.netの裏
  • A tutorial on the enumerator library

    This is a tutorial on the enumerator library, which is one implementation of Enumerator/Iteratee (EI) concept discovered by Oleg Kiselyov. The author of the library is John Millikin. EI is an API between a supplier (enumerator) and a consumer (iteratee). This API makes the following possible: Abstraction of data input sources If you implement a network code as iteratee, you can test it with just a

  • 使ってみよう Enumerator - あどけない話

    Enumerator Package - Yet Another Iteratee Tutorialは、Iteratee: 列挙ベースのI/Oよりは分かりやすいのですが、やっぱりよく分かりません。なぜなら、僕は使い方を知りたいのに、作り方が書いてあるからです。そこで、Enumerator ライブラリの使い方を簡単に紹介します。 登場人物 Iteratee 入力をもらって計算をします run_ で実行します IO モナドが指定されていれば、副作用を起こせます オートマトンと考えると分かりやすいです Iteratee 同士は (>>=) で合成できます Iteratee >>= Iteratee → Iteratee Enumerator Iteratee と ($$) で合成することにより、新たな Iteratee になります Enumerator $$ Iteratee → Iterate

    使ってみよう Enumerator - あどけない話
  • 1