タグ

monadに関するtlyncのブックマーク (4)

  • Functors, Applicatives, And Monads In Pictures - adit.io

    Written April 17, 2013 updated: May 20, 2013 Here's a simple value: And we know how to apply a function to this value: Simple enough. Lets extend this by saying that any value can be in a context. For now you can think of a context as a box that you can put a value in: Now when you apply a function to this value, you'll get different results depending on the context. This is the idea that Functors

    tlync
    tlync 2015/08/04
  • Originate

    Agile Innovation Built for Your Business For the past 15 years the world's most admired companies have looked to Originate to help them innovate with the latest technologies What We Do We’re a US-based agile innovation firm that works with clients to develop their digital product strategies and roadmaps, accelerate development with advanced technologies and best-in-class integrations; we deliver p

  • 圏論とかモナドなんて簡単だからscalaを使って説明してみた - だらだらしてたいなぁ

    はじめに 関数型といえばモナド、モナドといえば難しいという事が巷で言われていますが、いきなりモナドを理解しようとするから難しく思えるだけで、圏論から順序を追って理解していけば全然難しく無いんだよって事を分かって貰えればいいなぁと思い書いて見ることにしました。 ただ、圏論といっても適用範囲がとっても広く、応用編になると分けわかんなくなってくるので、ここではプログラミング分野に特化したFP(functional programing)圏論*1について書きます。 また、説明を簡単にする為に細かい部分をいろいろ省略しています。学術的な定義としては正確ではないので、このエントリの説明は大体合ってる位の気持ちで読んでくださいね。 尚、ぼくは圏論の詳しい事はさっぱり分からないので、学問的な話を振られても回答できませんキリッ 圏ってなんなの? 圏論と言えば、圏です。 圏って何なのかというと、対象(obje

    圏論とかモナドなんて簡単だからscalaを使って説明してみた - だらだらしてたいなぁ
  • Applicativeのススメ - あどけない話

    この記事の目的は、Applicative 信者による Applicative スタイルの布教です。 簡潔に結論を述べると、 foo = do a <- m1 b <- m2 return (f a b) のようなコードを書きたくなったら foo = f <$> m1 <*> m2 と書きましょうということ。 合い言葉は、「do と return をなくせ!」です。 FunctorとMonadの間 Functor を特殊化した型クラスがMonadで、Monadの方が強力です。なぜなら、メソッドが増えるからです。 Functorのメソッドはfmapです。fmapの別名を (<$>) といいます。(この記事では、(<$>) と liftM を同一視します。) そして、Monadのメソッドは、ご存知の通り (>>=) と return です。 FunctorとMonadの間にApplicative

    Applicativeのススメ - あどけない話
  • 1