並び順

ブックマーク数

期間指定

  • から
  • まで

361 - 400 件 / 701件

新着順 人気順

haskellの検索結果361 - 400 件 / 701件

  • Functors and Monads For People Who Have Read Too Many "Tutorials" - iRi

    Celebrating Over 10 Years Of Being Too Lazy To Pick A Tagline Title is literally true. This may not be the best place to learn about these concepts for the first time, because I'm going to focus on knocking down the misconceptions about them. Then again, it may not be the worst place, for the same reason. I had promised myself I would not add to the pile of functor or monad "tutorials", but I've b

    • A dead-simple web stack in Haskell | William Yao

      A dead-simple web stack in Haskell November 16, 2019 « Previous post Next post » Haskell has a proliferation of libraries to choose from for all of your basic backend needs, from logging to database access to routing and web server definition. It's nice to have the freedom of choice, but if you're just starting out, the amount of decisions needed can be overwhelming. Maybe you're not even confiden

      • 文脈依存 PEG による Haskell パーサ

        前に PEG パーサジェネレータライブラリ ptera を作っているという話をしたが,今回はその第二弾.ptera で Haskell2010 の文法パーサを例に追加してみたんだが,その過程で色々あったのでその備忘録. 結論から言うと,ptera に前回から以下の拡張を加えた. 先読みを強化し,もうちょっとちゃんと機能するように 文脈依存でパースができるようにした 後は,Template Haskell で文法書けるようにしたりもしたが,まあそれはいいでしょ. Haskell2010 と ptera ptera でひとまず Template Haskell で文法が書けるフロントエンド部分作った後,Haskell 2010 ぐらいパースできないと使い物にならないなあと言う感じで Haskell の example project 書いてみたんだが,ここで色々つまづいてしまった.主に今回説明

          文脈依存 PEG による Haskell パーサ
        • Async Exceptions in Haskell, and Rust - FP Complete

          Before getting started: no, there is no such thing as an async exception in Rust. I’ll explain what I mean shortly. Notice the comma in the title :). GHC Haskell supports a feature called asynchronous (or async) exceptions. Normal, synchronous exceptions are generated by the currently running code from doing something like trying to read a file that doesn’t exist. Asynchronous exceptions are gener

            Async Exceptions in Haskell, and Rust - FP Complete
          • 不動点コンビネータを用いた無名再帰関数の実行まとめ - Qiita

            諸般の理由で『Pythonのlambda式を用いたラムダ計算の基礎表現』を書いた後にHaskellに触れたところ,無名再帰関数を実行する不動点コンビネータfixがとんでもなく簡単に書けたため,同じ方法で他のプログラミング言語でもできないか試したところ,これまたあっさりできたので,まとめメモ的に新しく記事にした. このような内容がQiitaや書籍,ネット上に星の数の更に星の数乗ほどあることは承知しているが,この手の話はYコンビネータが大きな割合を占めており(実際,元記事でも取り上げている),関心のある人々の数多ある参考資料のひとつ程度に捉えてもらえると幸いである.ツッコミ,編集リクエスト歓迎. 不動点コンビネータの定義 不動点コンビネータとは,$f(g(f))=g(f)$が成り立つ関数$g$を指す.この記事では,Haskellの呼称であるfixを不動点コンビネータの関数名とする. Haske

              不動点コンビネータを用いた無名再帰関数の実行まとめ - Qiita
            • Haskellの型パズルで作るMini Interpreter

              「効率よく素数を計算するプログラムを作る課題」を出したら「コンパイル時に素数判定を行うプログラムが優勝した」なんて話がありますが[要出典]、今回は型レベル文字列で数式を渡すとコンパイル時に計算を行ってくれる型レベルインタプリタを作ってみようと思います[1] 動作イメージはこんな感じ > :kind! Calc "(1 + 1) * (2 + 0) + 10" Calc "(1 + 1) * (2 + 0) + 10" :: Nat = 14 GHCiで :kind! を使うと与えられた型の型シノニムや型族による変換を評価してくれます。つまり上記のプログラムは数式を表す型レベル文字列を評価してNatカインドの14という型に評価されているというわけです。 元ネタはQuramyさんのこの記事です 今朝この記事を引用した友人が 「文字列型を型レベルで扱える似たような機能って他の静的型付け言語にもあ

                Haskellの型パズルで作るMini Interpreter
              • Functional Design and Architecture (First Edition)

                Important: this is the First Edition of the book. * Consider buying Functional Design and Architecture (Second Edition) by Manning instead. * See also my new book Pragmatic Type-Level Design. FDaA is a fundamental book about Software Design in Haskell and other functional languages. The main idea of this book is to provide a comprehensive source of knowledge, and a complete methodology for buildin

                  Functional Design and Architecture (First Edition)
                • Haskellで型レベルパーサー

                  ghc-9.6.1です。 GHCはChar kindが9.2で入ったので型レベルパーサーが書ける様になってるんですよね。ということで書いてみました。 BNFは以下です: expr ::= term *('+' term) term ::= factor *('*' factor) factor ::= '(' expr ')' | nat nat ::= 0 | 1 | 2 | ... | 9 {-# Language TypeData #-} {-# Language DataKinds #-} {-# Language TypeFamilies #-} {-# Language UndecidableInstances #-} {-# Language TypeApplications #-} {-# Language MagicHash #-} {-# LANGUAGE NoStar

                    Haskellで型レベルパーサー
                  • 二分木をアプリカティブにする - Qiita

                    $\require{AMScd}$ 二分木 をアプリカティブにする 2018年のアドベントカレンダー25日目の記事「二分木をモナドにする」の続編です. 昨年の記事ではApplicativeの(<*>)の実装については一切説明しませんでした. 本記事ではこの(<*>)の実装を図式から導出してみようと思います. 1年ぶりなのでいちおう軽くおさらいをしておきます. おさらい Leafyな二分木に再登場してもらいます.

                      二分木をアプリカティブにする - Qiita
                    • kodimensional :: Avoiding space leaks at all costs

                      Avoiding space leaks at all costs Created: August 8, 2022 Haskell is a purely functional lazy programming language. The world doesn’t have a lot of lazy-by-default PLs. In fact, all mainstream languages have eager evaluation models. You may argue it’s because eager evaluation is better (because this is how the world works, obviously, only good things are popular). I tend to think this happened bec

                      • C++にモナドはいらない - Qiita

                        C++ Advent Calendar 2022 の 3 日目の記事 を読んだのですが、C++の規格を作っている人の中にモナドが好きな人がいるようで、仕様書の中にモナド的などという単語を必要もないのに入れようしているようです。それでモナドに興味を持った人もいるかと思って記事を書いてみることにしました。巷にモナドの説明自体はいっぱいあるんですが、Haskellを使って説明するものばかりで読みにくいですし、なんだか要領を得ないものが多いので、C++で説明する需要はあるだろうと思っています。ただし、C++でモナドを作っても意味がないよという否定的な意見を書きますので、そういうのがお好みでない方は許してください。 シンタックスシュガーがないのに、モナドを作るんですか? とりあえず説明のために簡単なIOモナドっぽいのものを書いてみます。まず、文字列を表示する動作を次のように書けるようにします。これは

                          C++にモナドはいらない - Qiita
                        • Winter is coming even more quickly – Blog – Joachim Breitner's Homepage

                          TL;DR: I explain how I improved the performance of an interpreter for WebAssembly written in Haskell by plucking some low-hanging fruit. Background Motivated by my work at the DFINITY Foundation, I was looking into interpreters for WebAssembly written in Haskell, and found my colleague John Wiegley’s winter: A straight-forward port of the WebAssembly reference interpreter, written in Ocaml by Andr

                          • 文字列を段階的に組み立てる - Qiita

                            プログラムで文字列を組み立てていると、 "(" ^ なにか ^ ")" のように、文字列結合で段階的に結果を組み立てたいことがある。 文字列が小さいことがわかっているうちはこれでもよいのだけれど、文字列が大きくなってくると段々と計算量が気になってくる(特に最適化をしていなければ、文字列の長さを n とすると結合のたびに O(n) のコストがかかる)。 左から右に組み立てることがわかっていれば、OCamlなら Buffer モジュールが使えるが、括弧のようなものがからむとそうも言っていられない。 stringを使うのをやめて、ropeのようなデータ構造を使う手もあるけど、依存ライブラリを増やしたくない場合もある(言語処理系によっては文字列の内部表現がropeになっていて以下のような小細工をする必要がない場合もある)。 ということで、自分でデータ構造をつくってみる。

                              文字列を段階的に組み立てる - Qiita
                            • GitHub - fumieval/Haskell-breaking-changes

                              You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

                                GitHub - fumieval/Haskell-breaking-changes
                              • GitHub - chr15m/flk: A LISP that runs wherever Bash is

                                A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

                                  GitHub - chr15m/flk: A LISP that runs wherever Bash is
                                • Windows10 HomeでDocker + VSCodeによるhaskellの環境構築 - Qiita

                                  はじめに いままでインタプリタ型・動的型付けの言語を使う機会の方が多かったです。 ただ、触っていくうちに「かっちりさ」に欠ける 気がしてしまったんです。 「70%の完成度でリリースできる」という言葉を聞いたことがあるくらいですからそれほど厳密さには焦点を絞っていないのだと思います。 もちろん、それがいいところだし、実社会ではその方がスピード感のあるリリースが可能になる分強いと思います。 ただ、コンパイラ型・静的型付けの言語も触ってみて両者の違いをつかんでみたいなという気持ちが湧いてきたんです。 (かっちりしてるものの方が扱いやすい気がするという好みの問題もあるんですが) しかも、オブジェクト指向に関してもJavaScript, Python, PHPと触っていくうちに雰囲気がつかめてきた(分かったとは言ってない)ので関数型なるものを触ってみたいという好奇心もあります。 そこでHaskell

                                    Windows10 HomeでDocker + VSCodeによるhaskellの環境構築 - Qiita
                                  • Fixed Points and Diagonal Arguments

                                    Fixed Points and Diagonal Arguments Posted by Bartosz Milewski under Programming [5] Comments What does Gödel’s incompletness theorem, Russell’s paradox, Turing’s halting problem, and Cantor’s diagonal argument have to do with the fact that negation has no fixed point? The surprising answer is that they are all related through Lawvere’s fixed point theorem. Before we dive deep into category theory

                                      Fixed Points and Diagonal Arguments
                                    • Simple Haskell

                                      Pure functions and strong types are the key to reliably delivering quality software. Industrial Haskell users are realizing that the key to delivering software on time and under budget is to keep it simple. We still have yet to fully leverage the value that Haskell98 has to offer through features like: Pure Functions Sum and Product Types Type Classes Polymorphism Accessibility Commercial software

                                      • LiquidHaskell Blog

                                        LiquidHaskell is a GHC Plugin Posted by Ranjit Jhala Aug 20, 2020 I enjoy working with LH. However, I’d be the very first to confess that it has been incredibly tedious to get to work on existing code bases, for various reasons. LH ran one file at a time; it was a hassle to systematically analyze all the modules in a single package. LH had no notion of packages; it was impossible to import specifi

                                        • regex-applicative: 内部DSLとしての正規表現(ブログ記事版) - Haskell-jp

                                          RegexFestaで発表した内容を詳しく紹介しますPosted by YAMAMOTO Yuji(@igrep) on December 30, 2019Tags: 正規表現 先日、といっても2019年10月18日のことなんでもう2ヶ月以上も経ってしまいましたが、私はRegex Festaというイベントで、「regex-applicative」というパッケージの紹介を致しました。 今回はその際使用したスライドを、ブログ記事として詳しく共有させていただきたいと思います! 発表時のスライドと比べて、よりHaskellを知っている人向けになってしまいますが、regex-applicativeの魅力を明確に伝えるために必要なのでご了承ください。 Applicativeスタイルを前提知識とします。 Link to hereはじめにまとめ regex-applicativeは、Haskellの式で正

                                            regex-applicative: 内部DSLとしての正規表現(ブログ記事版) - Haskell-jp
                                          • Typed Lisp, A Primer

                                            Typed Lisp, A Primer ⟨ Read as PDF or See the source ; Last modified on 2019-08-21 ⟩ Abstract Let's explore Lisp's fine-grained type hierarchy! We begin with a shallow comparison to Haskell, a rapid tour of type theory, try in vain to defend dynamic approaches, give a somewhat humorous account of history, note that you've been bamboozled —type's have always been there—, then go into technical deta

                                            • https://www.tweag.io/posts/2020-01-16-data-vs-control.html/

                                              • Haskell: The Bad Parts, part 1

                                                Haskell: The Bad Parts, part 1 Published October 28, 2020 There's a popular book called JavaScript: The Good Parts. And there's a common meme around the relative size of that book versus JavaScript: The Definitive Guide. Haskell is, in my opinion, a far more well designed and coherent language than JavaScript. However, it's also an old language with some historical baggage. In many ways, it's a bl

                                                  Haskell: The Bad Parts, part 1
                                                • Terminal Coalgebra as Directed Limit

                                                  Terminal Coalgebra as Directed Limit Posted by Bartosz Milewski under Programming 1 Comment Previously, we talked about the construction of initial algebras. The dual construction is that of terminal coalgebras. Just like an algebra can be used to fold a recursive data structure into a single value, a coalgebra can do the reverse: it lets us build a recursive data structure from a single seed. Her

                                                    Terminal Coalgebra as Directed Limit
                                                  • タイル型ウィンドウマネージャXmonadを使う(基礎編) | クロの思考ノート

                                                    こんにちは。今回のテーマは「タイル型ウィンドウマネージャXmonadを使う(基礎編)」です。タイル型ウィンドウマネージャとしてはAwesomeを紹介していましたが、同様なタイル型ウィンドウマネージャとしてXmonadも気に入って使っているので紹介したいと思います。ネット上に多くの設定例や情報があるのですが、今回は自分の備忘録も兼ねてまとめておきたいと思います。今回は基本的な使い方を扱います。詳細な設定とカスタマイズについてはタイル型ウィンドウマネージャXmonadを使う(カスタム編)をご覧ください。 [adsense02] 【目次】 Xmonadとは? Xmonadのインストール 設定とコンパイル 起動 再起動 Xmonadの終了 Xmonadの基本的な使い方 xmonad起動時時に他のプログラムを実行する 日本語入力環境について xmobarを使おう Xmonadとは? XmonadはH

                                                    • AI搭載エディタ「Cursor」にHaskellを書かせてみた

                                                      これは「Haskell Advent Calendar 2023」13日目の記事です。 日頃、私は趣味としてAIをHaskellで実装することに没頭しています。しかし、今回は少し違ったアプローチを試してみようと思います。逆に、AIにHaskellを使って自ら実装させ、その過程や成果を共有してみたいと考えています。この新たな取り組みがどのような結果を生むのか、一緒に探ってみましょう。 AI搭載エディタ「Cursor」 気を取り直して、今回は最近話題のAI搭載エディタ Cursor を使って実際に動くHaskellのアプリを0から作らせてみたいと思います!Cursorをまだ知らない人は以下の記事がオススメです(僕もまだこれしか読んでません🤫) Cursorのダウンロードとインストール、そしてアカウント登録が完了したらさっそくHaskellを書かせてみたいと思います。 それではレッツ・・・ ゴ

                                                        AI搭載エディタ「Cursor」にHaskellを書かせてみた
                                                      • Haskell: The Bad Parts, part 2

                                                        Haskell: The Bad Parts, part 2 Published November 9, 2020 If you didn't see it, please check out part 1 of this series to understand the purpose of this. Now, for more bad parts! Partial functions (in general) Laziness very likely belongs in this list. My favorite part of criticizing laziness is how quickly people jump to defend it based on edge cases. So let's be a bit more nuanced before I later

                                                          Haskell: The Bad Parts, part 2
                                                        • 不動点コンビネータで無名再帰を作る流れをおさらい - Qiita

                                                          どうも、趣味で関数型言語を書いている者です。 長らく関数型言語やってなかったら無名再帰を忘れかけていたので、おさらいがてら不動点コンビネータで無名再帰を作る流れを書き下します。 以下、Haskell の文法で書かれたコードをもとに説明していきます。 無名再帰とは? まずはモチベーションの確認から。 通常、再帰関数は、 といったように、関数定義の中で自分自身を呼ぶことで再帰処理を記述できます。 この例では、 sum (x:xs) = x + sum xs の部分で自分自身を呼んでいますね。 では、 関数に名前を付けることができない (無名関数しかない) 関数定義の中で自分自身を呼ぶことができない というような制限プレイの中で再帰をしたくなったらどうすればいいでしょうか? そんな要望に応えるために人類は 無名再帰 という方法を編み出しました。その名の通り、関数名に依らない再帰処理の方法です。

                                                            不動点コンビネータで無名再帰を作る流れをおさらい - Qiita
                                                          • Why is Prettier rock solid?

                                                            Why is Prettier rock solid?I've always wondered why Prettier is so good. Yes, it learnt from gofmt what to do (note that gofmt doesn't indent, which is the hard part). Yes, it was announced in a real life conference, which helped get the initial momentum behind it. All that is fine, but what was a bit inexplicable to me is its quality. You might disagree with the defaults (I like them. The only on

                                                            • Query-based compiler architectures | Olle Fredriksson's blog

                                                              Query-based compiler architectures by Olle Fredriksson 2020-06-25 Note: This is an old post originally from the documentation of the Sixten programming language, that I've touched up and fleshed out. After the time that it was written I've found out about Salsa, a Rust library with very similar goals to my Rock library, which is definitely worth checking out as well! Background Compilers are no lo

                                                                Query-based compiler architectures | Olle Fredriksson's blog
                                                              • Implementing graceful-close in Haskell network library - あどけない話

                                                                Closing connections gracefully is an old and new problem in network programming. In the HTTP/1.1 days, this did not get attention since HTTP/1.1 is a synchronous protocol. However, as Niklas Hambüchen concretely and completely explained, HTTP/2 servers should close connections gracefully. This is because HTTP/2 is an asynchronous protocol. Unfortunately, most HTTP/2 server implementations do not c

                                                                  Implementing graceful-close in Haskell network library - あどけない話
                                                                • Squeezing a sokoban game into 10 lines of code

                                                                  If you’re only interested in seeing or playing the game, you can find it on my GitHub. The occasion The Haskell Tiny Game Jam is a game jam which challenges participants to write a video game in Haskell using 10 lines of 80 characters. I happen to love Haskell and code golf (abusing a programming language to produce disgustingly short code for fun) so I decided to enter the Feb ‘23 jam. My journey

                                                                  • オンラインカジノ道しるべ

                                                                    オンラインカジノは、その多様なギャンブル体験と手軽なアクセス性により、多くの人々に愛されています。しかし、愛されている一方で、オンラインカジノは資金と個人情報の取り扱いに関わるため、適切な管理が欠かせません。その管理を規制し、監査を行うのが、オンラインカジノの運営ライセンスです。 運営ライセンスは、ギャンブルサイトが法的に運営され、プレイヤーに安全な環境を提供することを保証するものです。運営ライセンスの重要性、信頼性の高いライセンス発行国、そしてプレイヤーが注意すべき運営ライセンスについて説明し、オンラインカジノを選ぶ際の注意事項を説明していきます。 運営ライセンスは、オンラインカジノが正規の事業として運営できるようにする許可証です。このライセンスは、各国の政府や特定の発行機関によって発行され、厳格な審査を経て取得されます。ライセンスを持つオンラインカジノは、以下の点について規制と監査を受

                                                                      オンラインカジノ道しるべ
                                                                    • 型システム入門

                                                                      レビュー (日本語訳) 読み始めてから約3年ほどのゆったりペースで読み終わりました。 通称: TAPL (TaPL) (Haskell の) 型システムについて学習するために何か良い本ありませんか?と聞かれればたぶん全員がこの本をおすすめするんじゃないでしょうか。 最初から読めば最高にわかりやすい型システムの入門書です。しかし、多くの人が挫折している入門書です。(入門書詐欺という声もよく見かけますが、そんなことは無いです。ただたんに内容が難しい入門書というだけです) 特に書籍が分厚い (さらに1ページの情報量が多い) のでほとんどの人が11章の単純型付きラムダ計算の拡張の章を読み終わる前に途中で読むのをやめてしまっているような気がします。少なくとも11章までは読むべきです。この辺りまでであればインターネット上に解説などもあるため、ふんわりした理解でも読み進めることができると思います。また、

                                                                      • GitHubコメントを実行してあらゆることを自動化するGitHub Actions - Qiita

                                                                        やりたいこと GitHubのissueやプルリクエストのコメントに任意のスクリプトを書いてGitHub Actionsで実行したいです。 これができると色々と自動化できます。 例えば、 プルリクをマージした時のプレビュー npmのパッケージをアップデートして自動でプルリク SSHでGitHub Actions内に入ってデバッグ Python/Ruby/Go/Deno/Scala .... 任意言語の実行 LGTMの画像をコメント ... などなどアイデア次第でGitHubコメントする手軽さであらゆることを自動化できます。 npmでもaptでもpipでもgitでも色々コメントからGitHub完結で実行できます。 できたもの comment-runと呼んでます。 GitHub: https://github.com/nwtgck/actions-comment-run 上記のREADMEにここ

                                                                          GitHubコメントを実行してあらゆることを自動化するGitHub Actions - Qiita
                                                                        • Algebraic Effects に触れてみたくて Koka に入門した - Qiita

                                                                          はじめに 最近話題の Algebraic Effects に触れてみたくて、Koka に入門した。 記憶があるうちに、Algebraic Effects について学べるだけの Koka の最低限の文法や所感を記事にしておく。 ちゃんと探していないけれど、たぶん Koka の日本語の資料はない。よって何から何まで、公式の入門記事に頼ることになる。 そしてこの記事が、これから Koka に入門する人の助けになれば幸いだ。 私は以下のバックグラウンドを持ち、この記事にはそのバイアスがかかっている。予めご了承いただきたい。 Koka歴は 2日 Haskell はある程度使った。Extensible Effects にも触れている OCaml, Eff は未経験 タグに Haskell を入れたのは Koka のタグをフォローしている人は皆無だと思ったからだ。 ほんの少しだけ Haskell 成分が

                                                                            Algebraic Effects に触れてみたくて Koka に入門した - Qiita
                                                                          • 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

                                                                            • Haskell Database Implementation - Part 1, Growing a Tree

                                                                              Having started my career as a software developer in 2013 with an undergraduate degree in Mathematics, I never got the chance to take some of the higher-level courses on subjects like compilers, programming languages, or databases. In 2020 I set out to correct some of the gaps in my knowledge, and one of the ways I did so was by writing my own database, in Haskell, from scratch. This series of post

                                                                              • Seeking the reasons for segfaults of a Haskell program - あどけない話

                                                                                My open server of Haskell QUIC on Linux sometimes got segfaults. I saw two types of segfaults. One is a simple segfault by accessing a wrong address: mighty: segmentation fault The other is relating to free(): *** Error in `mighty': corrupted double-linked list: 0x00007fcdf0008f90 *** I guessed that a buffer overrun occurred against a buffer allocated by malloc() and this segfault happened when th

                                                                                  Seeking the reasons for segfaults of a Haskell program - あどけない話
                                                                                • Haskell Day 2021

                                                                                  日程の詳細はスケジュールをご覧ください。 発表者募集 発表者募集は締め切りました。 Haskell Day 2021 は YouTube プレミア公開を利用してオンラインで開催されます。発表をご希望の方は下記の要項をご確認の上、奮ってご応募ください。 応募資格 誰でも発表者として応募できます。 発表内容 Haskell に関する内容及び Haskell コミュニティが関心のありそうな内容であれば自由です。 参考(過去2回の発表タイトル): Haskell Day 2019 関数型(function type)を見つめるプログラミング HKD (Higher Kinded Datatype) 「しんさんきぼう」GHC の deriving テクノロジー Haskell メタプログラミングによる Egison のパターンマッチの実装 関数と型で理解する自動微分 GHCJS による Web フロ

                                                                                    Haskell Day 2021