タグ

javascriptとmonadに関するclavierのブックマーク (7)

  • 30分でわかるJavaScriptプログラマのためのモナド入門

    「30分でわかる」のは、だいたい、 4. モナド(Monad)とは何か? の読了までを想定しています。 また速い人なら、30分で全部一気に読み通せる分量でもあると思います。 30分以上かかっても一気読みしてしまうことが推奨されますし、一気読みできるように、前に戻って知識の再確認をしなくて済むように、最大限留意して構成を設計した上で執筆されています。 数学と用語問題。モナドの理論的基盤として圏論があるのは事実。理論的基盤がしっかりしているのはプログラミングという数学的作業において歓迎すべきことではある一方で、他方そのため一般的なプログラマにとってはまず用語に馴染みがない。歴史的に、圏論ベースのモナドを理論から関数型プログラミングに応用されていく過程では、実際、先駆者の間でさえ紆余曲折があったのだが、学習者へは馴染みのない用語を伴って、いきなり高度な数学的概念全開で天下り的に提示されてしまうこ

  • Practical Intro to Monads in JavaScript: Either — Evojam

    My simple and practical Intro to Monads in JS, where I covered basics of Identity and Maybe monads, seemed to be helpful for a lot of folks, so I’ve decide to continue the topic. Now it's time for Either - a tool for fast-failing, synchronous computation chains. A tool that may increase readability and quality of code while reducing error proneness. The best part is that we can still ignore the ca

    Practical Intro to Monads in JavaScript: Either — Evojam
  • JavaScriptのモナド | POSTD

    恒等モナド Maybeモナド リストモナド 継続モナド Do 記法 連鎖呼び出し モナド とは、一連のステップによって実行する計算を記述する際に使用する、1つのデザインパターンです。 純粋関数型プログラミング言語 では、モナドは 副作用を管理する ために広く利用されていますが、 マルチパラダイム言語では、モナドで複雑性を制御することもできます 。 モナドはデータ型をラップして、空の値を自動的に伝播したり( Maybe モナド)、非同期コードを簡略化したり( 継続 モナド)といった、新たな動作を既存のデータ型に追加します。 一連のコードをモナドと見なすためには、その構造には次に挙げる3つの要素が含まれていなければなりません。 型コンストラクタ — 基的な型に対してモナドの動作を追加した型を作成する機能です。例えば、基的なデータ型 number に対して、 Maybe<number> とい

    JavaScriptのモナド | POSTD
  • Douglas Crockford: Monads and Gonads (YUIConf Evening Keynote)

    In this evening keynote from YUIConf 2012, the legendary JavaScript architect Douglas Crockford discusses one of the most elusive of all programming concepts: the monads. With this talk, Crockford attempts to break the long-standing Monad tutorial curse by explaining the concept and applications of monads in a way that is actually understandable to the audience.

    Douglas Crockford: Monads and Gonads (YUIConf Evening Keynote)
  • モナドについて考えた記録 - 素人がプログラミングを勉強していたブログ

    Promiseってなんとなくモナドっぽいなと思って、ジェネレータ使ってHaskellのdoを再現できないかなあというのがはじまり。結論からいうと、できない。 そもそもPromiseがモナドであるかを考える。 return :: Monad m => a -> m a 値を受け取ってfulfilledされたPromiseを返すものだ Promise.fulfill / Promise.resolveがこれにあたる。 Promise.mreturn = Promise.fulfill || Promise.resolve; >>= :: Monad m => m a -> (a -> m b) -> m b bindとも呼ばれたりする。この関数に、値を受け取ってモナドを返す関数を渡すと、その値が結果になる。 Promise.prototype.mbind = Promise.prototype

    モナドについて考えた記録 - 素人がプログラミングを勉強していたブログ
  • Monads

    Monads All the code for this post are available here.https://github.com/santoshrajan/monadjs Consider the map functor from the last chapter. We could use map to iterate over two arrays adding each element of the first to the second. var result = [1, 2].map(function(i) { return [3, 4].map(function(j) { return i + j }) }) console.log(result) ==>> [ [ 4, 5 ], [ 5, 6 ] ] The type signature of the inne

  • はてなグループの終了日を2020年1月31日(金)に決定しました - はてなの告知

    はてなグループの終了日を2020年1月31日(金)に決定しました 以下のエントリの通り、今年末を目処にはてなグループを終了予定である旨をお知らせしておりました。 2019年末を目処に、はてなグループの提供を終了する予定です - はてなグループ日記 このたび、正式に終了日を決定いたしましたので、以下の通りご確認ください。 終了日: 2020年1月31日(金) エクスポート希望申請期限:2020年1月31日(金) 終了日以降は、はてなグループの閲覧および投稿は行えません。日記のエクスポートが必要な方は以下の記事にしたがって手続きをしてください。 はてなグループに投稿された日記データのエクスポートについて - はてなグループ日記 ご利用のみなさまにはご迷惑をおかけいたしますが、どうぞよろしくお願いいたします。 2020-06-25 追記 はてなグループ日記のエクスポートデータは2020年2月28

    はてなグループの終了日を2020年1月31日(金)に決定しました - はてなの告知
  • 1