タグ

Programmingとmonadに関するringo6119のブックマーク (2)

  • 並行プログラミングと継続モナド

    The document discusses LR parsing, which is a technique for parsing input strings according to a context-free grammar. It provides examples of parsing the input string "1 + 2 * 3" according to a sample grammar using an LR parsing table. Each step of the parsing is explained, including shifting and reducing grammar rules based on the table entries and the stack contents. The overall process demonst

    並行プログラミングと継続モナド
  • モナド教

    前提知識:モナド モナドを理解せずともモナド教を信ずることは出来ますが,理解していればより深く納得できるでしょう. 操作 :: 型 -> 型 は,"型"から"型"へ写す"操作"の存在を表します. モナドの文脈 m が必要とする2つの操作: return :: a -> m a で,値を保ちつつ文脈 m の中に入れ込むことが出来ます. (=<<) :: (a -> m b) -> (m a -> m b) で,「値を文脈に入った別の値へ写す操作」を「文脈に入った値を同じ文脈に入った別の値へ写す操作」に変換します. id :: a -> a は値をそのまま返す操作です. id を =<< で変換して得られる操作 join :: m (m a) -> m a で,二重に文脈に入った値を一重の文脈に入った値に戻すことが出来ます. 文脈の値から生の値を取り出す型 m a -> a を持つ操作は,一般

    ringo6119
    ringo6119 2014/08/14
    あの世で死んでも生き返ることができるのです.
  • 1