並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 40 件 / 638件

新着順 人気順

Haskellの検索結果1 - 40 件 / 638件

  • The sad state of property-based testing libraries

    The sad state of property-based testing libraries Posted on Jul 2, 2024 Property-based testing is a rare example of academic research that has made it to the mainstream in less than 30 years. Under the slogan “don’t write tests, generate them” property-based testing has gained support from a diverse group of programming language communities. In fact, the Wikipedia page of the original property-bas

    • Haskell: The Craft of Functional Programming (PDF)

      I’m happy to announce that the PDF of Haskell, The Craft of Functional Programming (3rd edition) is available to view and download for free. Later in the year I’ll revise it and make it available as an online text. But for now, here it is, uncorrected: https://simonjohnthompson.github.io/craft3e/craft3e.pdf

        Haskell: The Craft of Functional Programming (PDF)
      • Serverless Haskell - GHCのWASMバックエンドで Haskell を Cloudflare Workers に載せる


        Serverless Haskell - GHCWASM Haskell  Cloudflare Workers  TL;DR GHC 9.10  WASM  JavaScript FFI Haskell  Cloudflare Workers GHCCloudflare Workers  Asterius  GHC WASM  GHC  9.6  WASM GHC 9.10  WASM  JavaScript FFI   C FFI 使F
          Serverless Haskell - GHCのWASMバックエンドで Haskell を Cloudflare Workers に載せる
        • エフェクトとジェネレーターと - Object.create(null)

          2 年前に作って放置していたライブラリを最近ちょっと整理したのでその話. エフェクト プログラム中に登場する関数のことを考えてみましょう. 関数は引数を与えるとなんらかの計算を行い, 戻り値を返してくれます. もし関数が純粋な (数学的な意味での) 関数であれば, 関数の入出力は引数と戻り値だけです. つまり, 引数以外の入力 (例えば時刻) によって出力が変わることもなければ, 戻り値以外の出力 (例えば光や音) が得られることもありません. 一方で実用的な価値のあるプログラムというのは時刻に応じて光や音を発生させるようなものであり, これらは純粋な関数だけを組み合わせていては作ることができません. ここで登場する純粋でない関数は, 計算の過程でなんらかのエフェクトを発生させて, 引数と戻り値以外の入出力 (副作用) を行います. エフェクトの明示と副作用の分離 関数が発生させるエフェク

            エフェクトとジェネレーターと - Object.create(null)
          • Inside the Cult of the Haskell Programmer

            A regular column about programming. Because if/when the machines take over, we should at least speak their language. Haskell. It sounded like a good name for a weapon—a well-sharpened blade, like scimitar or katana. The strong German-sounding plosive in its name, as in Nietzsche or Kafka, added a menacing edge. All I really knew about the language was that it was challenging and intended for math

              Inside the Cult of the Haskell Programmer
            • The ultimate guide to Haskell Strings · Hasufell's blog

              © 2021. All rights reserved. Site created with Hakyll. Modified theme lanyon-hakyll based on Lanyon. The ultimate guide to Haskell Strings May 7, 2024, Posted by Julian Ospald This guide is aimed at Haskellers who seek to improve their understanding of String types, be it beginners or seasoned developers. It is also meant to be a quick reference/cheat sheet for deciding which string type to use in

              • Compiling higher order functions with GADTs

                Implementing first class functions in a bytecode interpreter is trivial. But how do compilers that generate machine code (or lower to C, or SSA) implement higher order functions? Back in 2021, I found an answer when contributing closures to the Pallene compiler. Today I was researching something loosely related, and found yet another neat trick called defunctionalization in this paper. Defunctiona

                • Development notes from xkcd's "Machine"

                  On April 5th, xkcd released Machine, the 15th annual April Fools project I’ve made with them. It’s a game we’d been dreaming of for years: a giant rube goldberg machine builder in the style of the classic Incredible Machine games, made of a patchwork of machines created by individual xkcd readers. For more details, check out Explain xkcd’s wonderful writeup. This is the story of how we built Machi

                    Development notes from xkcd's "Machine"
                  • Lix

                    declarative. reproducible. human-friendly.Lix is a modern, delicious implementation of the Nix package manager, focused on correctness, usability, and growth – and committed to doing right by its community. The Lix EcosystemLike other Nix ecosystems, Lix layers together multiple projects to create a full Lix stack — allowing you to forge your own systems on a base of community work. The Lix Packag

                      Lix
                    • CS SYD - Getting your Haskell executable statically linked with Nix

                      I have been making my products statically linked over the past few days. This post presents why and how to statically link your Haskell executables and collects a mapping from obscure error to unexpected fixes. This work would not have been possible without the many-year-long effort of people like nh2. This issue on GitHub is a good summary of what went into making this possible. Why statically li

                      • Direct-style Effects Explained

                        Direct-style Effects Explained By Noel Welsh on 24 Apr 2024 Direct-style effects, also known as algebraic effects and effect handlers, are the next big thing in programming languages. At the same time I see some confusion about direct-style effects. In this post I want to address this confusion by explaining the what, the why, and the how of direct-style effects using a Scala 3 implementation as a

                        • Choreographing a dance with the GHC specializer (Part 1)

                          Specialization is an optimization technique used by GHC to eliminate the performance overhead of ad-hoc polymorphism and enable other powerful optimizations. However, specialization is not free, since it requires more work by GHC during compilation and leads to larger executables. In fact, excessive specialization can result in significant increases in compilation cost and executable size with min

                            Choreographing a dance with the GHC specializer (Part 1)
                          • Knuth–Morris–Pratt illustrated | Journal of Functional Programming | Cambridge Core

                            We use cookies to distinguish you from other users and to provide you with a better experience on our websites. Close this message to accept cookies or find out how to manage your cookie settings.

                              Knuth–Morris–Pratt illustrated | Journal of Functional Programming | Cambridge Core
                            • Windowsで動くプログラミング言語に脆弱性、引数の扱い方の穴を突いて攻撃

                              CERT Coordination Center (CERT/CC, Carnegie Mellon University)は4月10日(米国時間)、「VU#123335 - Multiple programming languages fail to escape arguments properly in Microsoft Windows」において、Windows上で動作する複数のプログラミング言語から引数を適切にエスケープしない脆弱性を発見したと報じた。この脆弱性はアプリケーションのコマンドインジェクションにつながるとして注意を呼びかけている。 VU#123335 - Multiple programming languages fail to escape arguments properly in Microsoft Windows 脆弱性の詳細 多くのプログラミング言語にはオ

                                Windowsで動くプログラミング言語に脆弱性、引数の扱い方の穴を突いて攻撃
                              • Calling Haskell from Swift

                                struct User { let name: String let age: Int } // birthday(user: User(name: "Anton", age: 33)) = User(name: "Anton", age: 34) func birthday(user: User) -> User { // Calls Haskell function... } To support this workflow, we need a way to convert the User datatype from Haskell to Swift, and vice versa. We are going to serialize (most) inputs and outputs of a function. Even though the serialization as

                                • Flora :: [Package]

                                  A package repository for the Haskell ecosystem

                                  • ビジネスロジックを「型」で表現するOOPのための関数型DDD / Functional And Type-Safe DDD for OOP

                                    Object-Oriented Conference 2024で発表した資料です。 https://fortee.jp/oocon-2024/proposal/b31c9818-3cb8-4350-adfe-cbc839cdf829 ビジネスの専門知識(ドメイン)を中心に据えたドメイン駆動設計に…

                                      ビジネスロジックを「型」で表現するOOPのための関数型DDD / Functional And Type-Safe DDD for OOP
                                    • GHC 9.10の新機能

                                      GHC 9.10.1-alpha1が2024年3月14日にリリースされました。正式版のリリースは4月ごろを目指しているようです(9.10.1 · Milestones · Glasgow Haskell Compiler / GHC · GitLab)。 この記事では、GHC 9.10の新機能を確認していきます。過去の類似の記事は GHC 9.2の新機能と、GHCの動向2021 GHC 8.10とGHC 9.0の新機能 GHC 9.4の新機能 GHC 9.6の新機能 GHC 9.8の新機能 です。 この記事は網羅的な紹介記事とはなっていません。是非、公式のリリースノート類も参照してください: 2.1. Version 9.10.1 — Glasgow Haskell Compiler 9.10.0.20240313 User's Guide docs/users_guide/9.10.1-

                                        GHC 9.10の新機能
                                      • 継続モナドで立ち向かうローンパターンとEither地獄 - 星にゃーんのブログ

                                        Haskellでファイルなどのリソースの解放を保証するテクニックとして、ローンパターン(Loan Pattern)がある。withFile :: FilePath -> IOMode -> (Handle -> IO r) -> IO rなどがその例だ。 ローンパターンによる関数を複数使ったプログラムは、無名関数のネストが深くなる。 main = do withFile "src.txt" ReadMode \src -> withFile "dst.txt" WriteMode \dst -> ... この問題には、継続モナドContTを使ったきれいな解決策が知られている。 main = evalContT do src <- ContT $ withFile "src.txt" ReadMode dst <- ContT $ withFile "dst.txt" WriteMode .

                                          継続モナドで立ち向かうローンパターンとEither地獄 - 星にゃーんのブログ
                                        • UTF-8のバリデーションとモノイドと半群

                                          この記事はUTF-8のバリデーションとオートマトンの続きです。 前回はUTF-8のバリデーションが8状態のオートマトン (DFA) で表現できることを見ました。状態と遷移を擬似コードで書けば次のようになるでしょう: -- 8つの状態 data State = START | TAILx1 | TAILx2 | TAILx3 | A | B | C | D -- 入力バイトに応じて次の状態を返す。次の状態が該当しなかったら Nothing を返す next :: Word8 -> State -> Maybe State +----+----+-----+----+ | a0 | a1 | ... | aN | 8ビット整数列 +----+----+-----+----+ | | | v v v +----+----+-----+----+ | m0 | m1 | ... | mN | モノ

                                            UTF-8のバリデーションとモノイドと半群
                                          • インターフェースと型クラスの違いを考える

                                            この記事では、JavaライクなインターフェースとHaskellライクな型クラスを比較します。どちらも、複数の異なる型を統一的に扱うための仕組みです。 インターフェース インターフェースはご存知の方も多いと思いますが、コード例を載せておきます。 // インターフェースの定義 interface Greetable { String greet(); } // 実装の例1 class Hello implements Greetable { String message; Hello(String m) { this.message = m; } public String greet() { return "Hello " + message + "!"; } } // 実装の例2 class Goodbye implements Greetable { public String gree

                                              インターフェースと型クラスの違いを考える
                                            • Unification-free ("keyword") type checking

                                              From my perspective, one of the biggest open problems in implementing programming languages is how to add a type system to the language without significantly complicating the implementation. For example, in my tutorial Fall-from-Grace implementation the type checker logic accounts for over half of the code. In the following lines of code report I’ve highlighted the modules responsible for type-che

                                                Unification-free ("keyword") type checking
                                              • 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

                                                • 私とテストと自動化と - あどけない話

                                                  何度か講演でこの話をしたのだが、気が向いたのでエッセンスを書き下しておこうと思う。 テスト駆動という言葉が流行る前にプログラマとなった私は、当初どのようにテストを書いてよいのか分からなかった。そんなとき、(当時はオーム社で現在はラムダノートの)鹿野さんから「ビューティフルコード」を献本していただいた。分厚い本なので、興味ある章から読んでいった。その一つがアルベルト・サボイア氏が書いた7章「ビューティフル・テスト」だ。 ビューティフルコード (THEORY/IN/PRACTICE) 作者:Brian Kernighan,Jon Bentley,まつもとゆきひろオライリージャパンAmazon この章では、例として二分探索が取り上げられる。二分探索のアイディアが出されたのは1946年だが、バグのない実装ができたのは12年後だという。実際に実装してみると分かるが、ソートされた配列の中に目的の要素が

                                                    私とテストと自動化と - あどけない話
                                                  • GitHub - ambulancja/mariposa: A toy programming language with time travel

                                                    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. Dismiss alert

                                                      GitHub - ambulancja/mariposa: A toy programming language with time travel
                                                    • GitHub - augustss/MicroHs: Haskell implemented with combinators

                                                      This repository contains an implementation of an extended subset of Haskell. It uses combinators for the runtime execution. The runtime system has minimal dependencies, and can be compiled even for micro-controllers. The boards/ directory contains some samples, e.g., some sample code for an STM32F407G-DISC1 board. The compiler can compile itself. There are two different ways to compile MicroHs: Us

                                                        GitHub - augustss/MicroHs: Haskell implemented with combinators
                                                      • AtCoder ガチ言語 Haskell 🔥

                                                        Haskell で AtCoder に入門しましょう

                                                          AtCoder ガチ言語 Haskell 🔥
                                                        • 2023年にHaskell関連で知ってよかったこと - あどけない話


                                                          Haskell Advent Calendar 202319  fourmolufourmoluOrmoluOrmoluformolu Hackage % cabal install fourmolu formoluHaskell-iIDE % find . -name "*.hs" | xargs fourmolu
                                                            2023年にHaskell関連で知ってよかったこと - あどけない話
                                                          • 2023年の Linear Haskell で純粋・並列 FFT を実装する──「Haskell は Rust になれるのか?」補遺

                                                            この記事は Haskell Advent Calendar 2023 14 日目の記事です[1]。 更新履歴 2023-12-15 並列化のパフォーマンスに関する追記。 2023-12-14 初版公開。 はじめに 先々月、Linear Haskell のまとまりのない記事を書いたところ、思ったよりも反響を頂いてびっくりしました。 ただかなりまとまりのない長文だった結果、「長い」「結局 Rust になれるのかようわからん」といった御叱りを頂きました。本当にすいません……。 冒頭に「RustのようになるにはLinear Constraintsに期待」とか、末尾に「2023年のHaskellはまだ Rust ではないが、近い将来 Rust になれる可能性が大きい」とか書きはしましたが、全体があまりにも長いのでこの結論を見つけ出すのも大変ですし、話題があんまり散漫に過ぎまたので論拠もすごくわかりづ

                                                              2023年の Linear Haskell で純粋・並列 FFT を実装する──「Haskell は Rust になれるのか?」補遺
                                                            • AI搭載エディタ「Cursor」にHaskellを書かせてみた


                                                              Haskell Advent Calendar 202313 AIHaskellAIHaskell使AICursor AI Cursor 使Haskell0Cursor🤫 CursorHaskell  
                                                                AI搭載エディタ「Cursor」にHaskellを書かせてみた
                                                              • TypeScriptでどこまで「関数型プログラミング」するか ─ 「手続き Haskell」から考察する - 一休.com Developers Blog

                                                                この記事は 一休.comのカレンダー | Advent Calendar 2023 - Qiita 10日目の記事です。 昨今は Web アプリケーション開発の世界でも、関数型プログラミングのエッセンスを取り入れるような機会が増えてきました。 とはいえ、一つのアプリケーションを 1 から 10 までがっちり関数型プログラミングで構成するというわけではなく、そのように書くこともあればそうでない従来からの手続き的スタイルで書くところもあるというのが現状で、どこまで関数型プログラミング的な手法を取り入れるかその塩梅もまちまちだと思います。まだ今はその過渡期という印象も受けます。 本稿ではこの辺りを少々考察してみたいと思います。 先日、Qiita Conference 2023 Autumn で以下のテーマで発表を行いました。 この発表では「関数型プログラミング最強!」という話をしたわけではなく、

                                                                  TypeScriptでどこまで「関数型プログラミング」するか ─ 「手続き Haskell」から考察する - 一休.com Developers Blog
                                                                • Haskellのzip関数を一般化すると何になるか

                                                                  この記事は Haskell Advent Calendar 2023 の7日目の記事です。 zip関数について Haskellには zip 関数というものがあります。この関数は、2つのリストを受け取って、それぞれから取り出した要素を組にしたリストを返します。

                                                                    Haskellのzip関数を一般化すると何になるか
                                                                  • 四元数ニューラルネットワークとGHR微積分

                                                                    これは「FOLIO Advent Calendar 2023」6日目の記事です。 ニューラルネットワークで取り扱う数値を実数とは異なる数に拡張することは、機械学習や計算科学の発展における魅力的な課題の一つです。実数を用いた数値表現は多くのタスクにおいて十分な結果をもたらしてきましたが、新たな数値体系を導入することで、今までとは異なる問題が解決できるようになったり実数では見られなかった新たな現象が起こる可能性に期待することができるでしょう。例えば数値が取れる値を±1に制限したBinalized Neural Networksはハードウェアとの相性が良くメモリ効率の良い実装が可能であったり、拡大実数\bar{\mathbb R}={\mathbb R}\cup\{-\infty,\infty\}を用いた5層のReLUネットワークには任意の深さのReLUネットワークを埋め込むことができたりします

                                                                      四元数ニューラルネットワークとGHR微積分
                                                                    • Haskell の Array


                                                                      Haskell | Advent Calendar 2023 - Qiita 3 Haskell  Array () Haskell  Array Ix便 便 Array  Haskell  Array  Array !! O(n)  Haskell  O(1)  Vector (vector: Efficient Arra
                                                                        Haskell の Array
                                                                      • Haskellで、手軽にプロパティベーステスト

                                                                        はじめに Haskell Advent Calender 2023の2日めの記事です。カレンダーの枠が空いていたので、久しぶりに勢いで書いてみました。 さて、ラムダノート社から「実践プロパティベーステスト」が出版されたので、巷ではプロパティベーステストが流行っていることでしょう (紹介宣伝です)。 Haskellでは、プロパティベーステスト用のライブラリとして、例えばQuickCheckがあります。 この記事では、Haskellではソースコードのコメント中に簡単な記述をするだけで、プロパティベーステストを手軽に実行できることを改めて紹介します。 本格的なコードを開発している局面だけではなく、ちょっと頭の中を整理したい時などにも手軽で便利です。 (前準備) テストケースと期待値によるテスト Haskellでは、ソースコードのコメント中に埋め込まれたテストケースを実行できるdoctestという

                                                                          Haskellで、手軽にプロパティベーステスト
                                                                        • Reddit で振り返る今年の英語圏 Haskell 界隈の話題 - Qiita


                                                                          Haskel advent calendar 2023 1  e-Gov  XML Haskell  Hoogle 使 GHCup Haskell Language Server  Advent Calendar 1 @mod_poppo   
                                                                            Reddit で振り返る今年の英語圏 Haskell 界隈の話題 - Qiita
                                                                          • A Fistful of Automata

                                                                            20 October 2023 Recently, I have been brushing up my knowledge of Formal Languages and stumbled again into the many different faces of finite automata. Most materials present DFAs, NFAs and company as distinct beasts, each with their own properties and theorems. Nevertheless, I couldn’t get out of my mind that all definitions seemed too similar. After hitting my head into a couple walls, I finally

                                                                            • 関数型プログラミングと型システムのメンタルモデル

                                                                              Qiita Conference 2023 Autumun での発表資料です 発表時間の見積もりが下手で後半全然説明できませんでした、すみません! 実際のプロダクト開発ではどうすればいいのか? というケースは以下のスライドを参照してください。 (本スライドは、こちらのプロダクト開発の経験をベースに基礎を再整理したものになります) https://speakerdeck.com/naoya/typescript-niyoru-graphql-batukuendokai-fa-75b3dab7-90a8-4169-a4dc-d1e7410b9dbd

                                                                                関数型プログラミングと型システムのメンタルモデル
                                                                              • λm.me - An alternative frontend for Haskell?

                                                                                In CppCon 2022, Herb Sutter gave a talk titled Can C++ be 10x Simpler & Safer? where he described an alterntive syntax that compiles to C++ (which he calls CppFront or Cpp2) that could remove much of the existing issues with C++ - reduce complexity, increase safety, and more. If you haven't seen it yet, it's worth a watch! With recent events and discussions in the Haskell community, my mind went b

                                                                                  λm.me - An alternative frontend for Haskell?
                                                                                • unsafePerformIOではじめる愉快なHaskellプログラミング


                                                                                  HaskellIO使[]使 HaskellIO unsafePerformIO 使IO module System.IO.Unsafe where --  unsafePerformIO :: IO a ->a
                                                                                    unsafePerformIOではじめる愉快なHaskellプログラミング