並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 12 件 / 12件

新着順 人気順

Monadの検索結果1 - 12 件 / 12件

タグ検索の該当結果が少ないため、タイトル検索結果を表示しています。

Monadに関するエントリは12件あります。 プログラミングHotEntryHaskell などが関連タグです。 人気エントリには 『ソフトウェアエンジニアとしてモナドを完全に理解する / make-perfect-sense-of-monad』などがあります。
  • ソフトウェアエンジニアとしてモナドを完全に理解する / make-perfect-sense-of-monad

    人類には早すぎる、謎の計算ロジックに立ち向かう / Strugle with the most complicated logic ever

      ソフトウェアエンジニアとしてモナドを完全に理解する / make-perfect-sense-of-monad
    • Type level mapを使ったpreload風関連リソースの取り回し。Indexed monad添え

      この記事はHaskell Advent Calendar 202011日目の記事です(遅延)。 大晦日です。いかがお過ごしでしょうか。 Haskellでapi server等を作った際、rdbへの問い合わせでPreload的なことを行う箇所で、Type level mapを使った所、なかなかの使い勝手だったので、共有します。 さらにIndexed Monadを使い、明らかに残念だった箇所を改善します。 preload? 1+N問題を起こさぬよう、事前に関連リソースを問い合わせておくもの。prefetchとかとも。 posts = Post.find(...) # query Post # view for p in posts for t in p.tags # ここで問い合わせるとN回なので、事前に問い合わせていて欲しい render t やること viewが要求するpreloadを定義

        Type level mapを使ったpreload風関連リソースの取り回し。Indexed monad添え
      • Functor, applicative, and monad - TAH's Site

        Functor, applicative, and monad are related concepts that frequently arise in functional programming. These three ideas give a name to common patterns across different operations defined on different data types, so recognizing their occurrences are important. However, these entities are shrouded in mystery, being associated with "category theory," and in particular, monads have been elevated to a

        • Extensible Effects: beyond the Monad Transformers

          This presentation includes these following three things: 1. Monad 2. Monad Transformers 3. Extensible-Effects Main topics are how to use atnos-eff and comparison between mtl and eff.

            Extensible Effects: beyond the Monad Transformers
          • How does the continuation monad work? | Max Hallinan

            I had trouble using the continuation monad until I understood how it works. Here is what I wish I knew from the beginning. The examples are written in PureScript. What is a continuation? A continuation is the next step in a computation. Consider this expression: 3 * (2 / 2) + 1 We start by evaluating the sub-expression 2 / 2. Let’s replace it with a placeholder for the value of that expression. 3

            • Lysxia - The reasonable effectiveness of the continuation monad

              There are common monads associated with common effects: Maybe for failure, [] (list) for nondeterminism, State for state… What about the continuation monad? We shall see why the answer is all of the above, but better. Indeed, many effects can be understood and implemented in a simple and uniform fashion in terms of first-class continuations. Extensions and imports for this Literate Haskell file {-

              • Writer Monadで気軽にMonad則を破る - Haskell-jp

                Tweet 🎅この記事は、Haskell Advent Calendar 2020 25日目の記事です。 🎄Happy Christmas!!🎄 今回は先日(といっても元の質問の投稿からもう何ヶ月も経ってしまいましたが…)StackOverflowに上がったこちら👇の質問に対する回答の、続きっぽい話を書こうと思います。長いし、質問の回答からスコープが大きく外れてしまうので記事にしました。 haskell - モナド則を崩してしまう例が知りたい - スタック・オーバーフロー MonadとMonoidにある重要な繋がりを説明した後、それを応用したWriter MonadがどうMonoidを使ってMonad則を満たしているのか証明します。そして、Writerのそうした性質を用いて簡単にMonad則を破る例を紹介することで、読者のみなさんがMonad則のみならずdo記法やMonadそのもの

                  Writer Monadで気軽にMonad則を破る - Haskell-jp
                • Monad Transformers and Effects with Backpack

                  A good few years ago Edward Yang gifted us an implementation of Backpack - a way for us to essentially abstract modules over other modules, allowing us to write code independently of implementation. A big benefit of doing this is that it opens up new avenues for program optimization. When we provide concrete instantiations of signatures, GHC compiles it as if that were the original code we wrote,

                  • ふみ a.k.a.DJ Monad on Twitter: "「配列のすべての要素が条件を満たすならtrueを返す」関数を定義するとき、空の配列を渡したらfalseを返すかtrueを返すかが、良いプログラマかどうかの一つの境目だ"

                    • はじめての Monad, Monad Transformer, Extensible Effects | Recruit Tech Blog

                      はじめての Monad, Monad Transformer, Extensible Effects Ariizumi Shumpei こんにちは。RECRUIT Job for Student 2021 Summer で、スタディサプリ ENGLISH の開発を行なっていた有泉洵平です。 スタディサプリ ENGLISH のサーバサイドでは Extensible Effects を導入しています。それを扱うにあたり Monad, Monad Transformer, Extensible Effects を学んだため、この記事にまとめます。 また、RECRUIT Job for Student 2021 Summer に興味のある方は、そちらについても記事を書いたため、参考にしてください。 要約 Monad とは、pure と flatMap というメソッドを持ち、Monad 則を満たすも

                        はじめての Monad, Monad Transformer, Extensible Effects | Recruit Tech Blog
                      • Free Monadで言語内DSLをつくろう - 雨粒blog

                        抽象構文木の構築とその評価の分離 インタプリタやコンパイラでは最初に、コードの文字列を構文解析して抽象構文木 (AST) を構築する。その表現形式はDAGやSSAなどに変化して行くことも多いが、基本的にはこれらの中間表現に対して様々な最適化がほどこされる。インタプリタの場合にはこれが評価され実行されるが、コンパイラの場合にはこれがアセンブリの命令に置き換えられ、スケジューリングされ、レジスタが割り当てられ、最終的にはバイナリが生成される。こうした構文解析や構文木の構築と、中間表現の最適化、その評価の分離は、各工程をそれぞれ独立に作成し、必要に応じて取り替えられるという意味で、とても便利だ。 言語内DSLの処理系をそこまで重くするのは本末転倒感があるが、少なくとも構文木を構築しその評価と分離することは、抽象化の手段として適切な場合もあると思う。Haskellでは、言語内DSLのコードとその評

                          Free Monadで言語内DSLをつくろう - 雨粒blog
                        • Monad は継続、Applicative は並列

                          Scala の cats のドキュメント群が Monad に関する説明としてすごくわかりやすかったので、そこで学んだことをまとめておこうと思った。 モナドを理解したい モナドを理解したいというモチベーションをずっと持っている。Wasm 文脈で Rust に入門しそこで Option や Result と出会い、OCaml で Monadic Parser を意味も分からず実装し、そのための勉強で Parsec を知りH 本で Haskell と一緒に勉強したり、同僚に Scala と cats を布教されたりで、長いことモナド周りの技術に触れている。しかし今でもきちんと理解できている自信がない。何が理解できないのだろうか。 H 本で学んだこと H 本は型クラスについて解説したあとに Functor の説明に入る。ここでは文脈を持った値、文脈を維持したまま関数を適用できる関数として fmap

                            Monad は継続、Applicative は並列
                          1

                          新着記事