並び順

ブックマーク数

期間指定

  • から
  • まで

161 - 200 件 / 275件

新着順 人気順

haskellの検索結果161 - 200 件 / 275件

  • adventures in uncertainty: Towards Faster Iteration in Industrial Haskell

    2020-04-14 I’ve been writing Haskell in industry for the last eight years, at four different employers. I’ve been a full-time Haskell programmer since 2014. Though I never anticipated this turn of events, I’m certainly not complaining: I truly like writing Haskell, and I’m experienced enough in it to write at or exceeding the speeds at which I can write in the imperative languages I used before Ha

    • Leaving Haskell behind

      For almost a complete decade—starting with discovering Haskell in about 2009 and right up until switching to a job where I used primarily Ruby and C++ in about 2019—I would have called myself first and foremost a Haskell programmer. Not necessarily a dogmatic Haskeller! I was—and still am—proudly a polyglot who bounces between languages depending on the needs of the project. However, Haskell was m

        Leaving Haskell behind
      • The tale of keepAlive# — The Glasgow Haskell Compiler

        bgamari - 2021-06-08 In GHC 9.0 we have reworked the primops used for guaranteeing heap object lifetime in the presence of off-heap references. The result is a new primop, keepAlive#, which largely replaces the venerable touch# operation. This post will give some background on touch#, describe the rationale for this change, discuss some of the alternatives that were evaluated on the way to this ne

        • Try.do for recoverable errors in Haskell

          UPDATE 2021-01-02: I have since written a GHC compiler plugin to implement an alternative ?-based syntax for early return. I prefer that one than use of Try.do, because it doesn’t require any type magic or special instances, and the ? is more readable. UPDATE: I’ve added a follow-up post to this here, where I address some criticisms of this post. The first half of this post is here. Please read th

          • Haskellの型システムについての1人語り - Qiita

            まえがき 周りにHaskellerがいなくて、話す友達もいないので誰かに語りたくなりました。 なにも実のない自己満足の記事です。 対象者 Haskell入門した人 Haskellちょっとだけわかる人 Haskellちょっとだけ学んだけどなにがいいんだ???ってなってる人 本編 今回話したいのはずばり、関数持ち上げです。これだけです。 Haskellを学んだ人ならお馴染みだと思いますが、関数持ち上げについて少し説明すると、通常の引数を取る関数を、モナドやファンクターを取る関数に変えることです。 例を上げると、

              Haskellの型システムについての1人語り - Qiita
            • linear-base makes writing Linear Haskell easy and fun

              We’re announcing linear-base, a standard library for Linear Haskell programs. Our release accompanies the release of GHC 9.0 which supports -XLinearTypes. Linear base has been written by Bhavik Mehta, a former Tweag intern, Arnaud Spiwack, and ourselves. In the spirit of a standard library, linear-base is not a strict replica of base with linearly-typed variants of all the facilities in base. Inst

                linear-base makes writing Linear Haskell easy and fun
              • GitHub - IHaskell/learn-you-a-haskell-notebook: Jupyter adaptation of Learn You a Haskell for Great Good!

                Read the book right now on mybinder.org with this link: (Usually takes a minute to launch) This is a Jupyter notebook adaptation of the book Learn You a Haskell for Great Good! by Miran Lipovača. I learned Haskell from this book in 2014 by following along in GHCI, as the book suggested. In 2019, the Jupyter notebook format would be a nice way read this book. This is one of the best cases for Theod

                  GitHub - IHaskell/learn-you-a-haskell-notebook: Jupyter adaptation of Learn You a Haskell for Great Good!
                • Haskellの文字列型:変換時の心構えと変換方法まとめ - Qiita

                  先の記事では、Haskellエコシステムに色々ある文字列型を分類しました。この記事では、色々ある文字列型を変換する方法を説明します。 パッケージの依存関係:変換関数を探すにはどこを見れば良いか 各種文字列型や変換関数を提供するパッケージ間の依存関係は次のようになっています(依存元パッケージから依存先パッケージに矢印を伸ばしています): 当たり前ですが、変換関数が用意されているとしたら変換元の型と変換先の型の両方を参照できるパッケージです。つまり、 Text と ByteString の変換関数を探したかったら bytestring パッケージではなく text パッケージを探すべきです。なぜなら、 bytestring パッケージの関数は Text 型には言及できないからです。 同様の理由で、 ByteString と CStringLen の変換関数を探したかったら bytestring

                    Haskellの文字列型:変換時の心構えと変換方法まとめ - Qiita
                  • GitHub - serokell/haskell-with-utf8: Get your IO right on the first try

                    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 - serokell/haskell-with-utf8: Get your IO right on the first try
                    • 2023年にHaskell関連で知ってよかったこと - あどけない話

                      これはHaskell Advent Calendar 2023の19番目の記事です。 フォーマッター 以前、フォーマッターをいくつか試しましたが、どれもイマイチでした。しかし、fourmoluはいけてます。fourmoluは、Ormoluのフォークで、Ormoluが偉大なのでしょう。両方試しましたが、僕はformoluに決めました。 Hackageに上がっているので好きな方法でインストールしてください。 % cabal install fourmolu formoluにHaskellのプログラムを渡すと、整形したプログラムを出力してくれます。ファイルの内容を直接書き換えたいときは、-iオプションを渡します。エディタやIDEと連動できますが、お試しでプロジェクト全体を整形するには、以下のようにするといいでしょう。 % find . -name "*.hs" | xargs fourmolu

                        2023年にHaskell関連で知ってよかったこと - あどけない話
                      • Writing prettier Haskell with Unicode Syntax and Vim

                        A short write-up on combining digraphs, a feature built-in to vim, and Haskell's UnicodeSyntax extension, to easily write beautiful Haskell programs with unicode symbols. #haskell#vim 1 Haskell’s Unicode Syntax Extension Haskell (well, GHC Haskell) features an extension called UnicodeSyntax. When enabled, this extension allows the use of certain unicode symbols in place of their corresponding keyw

                        • haskellでif文を使いたい

                          2つの引数の数字を比較して大きい方をx小さい方をyに入れて返すという関数をhaskellのif文で実装したいと考えています。引数1つのサンプルを参考にして下記を作成したのですが else temp=x x=y y=temp ---------- ^ Failed, no modules loaded. temp=xで上記のようなエラーが出ます. おそらく書き方が間違えていると予想しているのですが、どこが間違えているかわかりません。教えてください。 haskell

                            haskellでif文を使いたい
                          • Haskell で GitHub Actions する

                            本記事は「Haskell Advent Calendar 2019」の2日目の記事です. 2019/11/13 に GA された GitHub Actions を使って,Haskell プロジェクト,とりわけ Haskell Stack を使ったプロジェクトを CI/CD します. ちなみに,試すために導入した PR はこれです: 自動ビルドを追加 by matsubara0507 · Pull Request #1 · matsubara0507/octbook これは適当な設定ファイルから GitHub の Organization や Organization の Team 機能にユーザーを招待したりキックしたりするための CLI ツールです. Cabal の場合 はわりかし簡単. Haskell のセットアップは公式がすでに用意してくれてるのでこれを使えば良い: actions/s

                            • A Haskell retrospective

                              Approximately a year ago, I had the opportunity to work on Sigma — a large, distributed system that protects Facebook users from spam and other kinds of abuse. One reason it was a pretty unique experience is that Sigma is almost entirely a Haskell codebase. It was the first time I got to work with the language in a professional setting, so I was eager to see how it performs in a real-world, produc

                                A Haskell retrospective
                              • Compiling a subset of JavaScript to ARM assembly in Haskell - Micah Cantor

                                A toy compiler for a subset of JavaScript to ARM assembly, using Haskell. Published: May 29, 2022 I recently got a copy of the book Compiling to Assembly from Scratch by Vladamir Keleshev, which details how to write a compiler for a subset of JavaScript to 32-bit ARM assembly code. The choice to use ARM assembly is mainly for its simplicity in comparison to x86. Keleshev elects to use TypeScript t

                                  Compiling a subset of JavaScript to ARM assembly in Haskell - Micah Cantor
                                • [Haskell]Data.Listの関数まとめ - Qiita

                                  Haskell の Data.List 関数まとめ Haskell の標準ライブラリの Data.List のページにある関数(117 個)がかなり便利だったのでまとめてみました。 注意点 この記事はとても長いです。 自分もまだまだ Haskell を書くのは上手ではないので、誤りなどあれば教えていただければ幸いです。 この記事を書くのに使用した環境は以下の通りです。 GHC: v8.6.5 GHCi: v8.6.5 ここに載っている関数は以下の操作で使うことができます。 ソースファイル: import Data.List GHCi: :module +Data.List ただし、以下の関数はPreludeに含まれているのでインポートする必要はありません。 (++), head, tail, last, init, null, length, map, reverse, foldl, fo

                                    [Haskell]Data.Listの関数まとめ - Qiita
                                  • Parsing With Haskell (Part 1): Lexing With Alex

                                    This is the first of the two parts of our Parsing with Haskell series. Looking for the second part instead? You can find it here. This two-part tutorial will look into two tools often used together by Haskellers to parse programs: Alex and Happy. We’ll use them to parse a small programming language from scratch. Both Alex and Happy are industrial-strength tools powerful enough to parse even Haskel

                                      Parsing With Haskell (Part 1): Lexing With Alex
                                    • HaskellでもDirectX12したい! - Qiita

                                      描けた! pic.twitter.com/3h0Jtmlw7U — 🌌S.Percentage🙀 (@Pctg_x8) September 15, 2020 リポジトリはこちら: https://github.com/Pctg-x8/haskell-d3d12-test HaskellのFFI 今回はDirectX12に主軸をおいた記事ではないため、DirectX12の初期化の方法などは解説しません。他の記事をご参照ください。 Haskellも実用的なプログラミング言語の例に漏れず、C言語など他の言語とのインターフェイス(FFI)の仕組みを持っています。 Haskellのそれはかなり「低レベル」かつ「なんでもあり」な感じになっています。 HaskellのFFIの詳細については他の記事を参照してもらうとして、大雑把には以下のような形でインターフェイスが提供されています。 基本データ型 F

                                        HaskellでもDirectX12したい! - Qiita
                                      • 米田の補題、Free theorem と病的な Haskell の関数 - Qiita

                                        まとめ 黒魔術を使うと米田の補題による制限を回避して自由闊達に関数が書けます。 前提知識 Haskell の知識、多相関数に関する知識を仮定します。圏論の知識はほとんど仮定しません。 説明 記法 F や A などの大文字始まりの型名はすべてなんらかの具体的な型がそこに入ります。 x や a などの小文字始まりの型名は型変数です。(Haskell での流儀と一緒です。) 自然変換 Functor インスタンスが実装されている 2 種類の型 F と G、および多相関数 u :: forall x. F x -> G x について、以下のような法則が成り立つ時、u は自然変換であるといいます。

                                          米田の補題、Free theorem と病的な Haskell の関数 - Qiita
                                        • Create a Windows installer for your Haskell project · PatchGirl

                                          Create a Windows installer for your Haskell projectIn this blog post, I’ll try to explain how you can create a really simple installer for your Haskell software on Windows and how to deal with external dependencies. IntroductionAlright, let’s get started. We are going to build a simple installer. It will install a desktop shortcut as well as a link shortcut in the start menu. We will be using Stac

                                          • The state of GHC on ARM — The Glasgow Haskell Compiler

                                            bgamari - 2020-05-15 The ARM architecture represents an overwhelming majority of CPUs on this planet. Furthermore, there are now GHC users (myself included) who stake their livelihood on being able to deploy their Haskell applications on ARM-based platforms. As such, the task of making GHC run well on ARM has never been more important. This task has a long history, being the project that brought m

                                            • Knuth-Morris-PrattアルゴリズムのHaskellでの実装の解説 - Qiita

                                              はじめにのまえに この記事はHaskell Advent Calendar 2019の19日目の記事の補足です。よくばってネタを増やしすぎたので、一部の話題をこちらにわけました。もとの記事でも、かんたんに説明していますが、こちらのほうがより、ていねいな説明になっています。 はじめに 文字列のなかから「特定の並びの文字列の位置」を抽出するアルゴリズムで、有名なものにBoyer-MooreアルゴリズムとKnuth-Morris-Prattアルゴリズム(以下、KMPアルゴリズムと表記)とがある。後者のHaskellによる実装について解説する。実装は「関数プログラミング 珠玉のプログラミングデザイン(以下PFADと表記する)」のものを紹介する。 サンプルコード サンプルコードは、つぎのリポジトリに置いてある。参考にしてほしい。 GitHub: YoshikuniJujo/test_haskell/

                                                Knuth-Morris-PrattアルゴリズムのHaskellでの実装の解説 - Qiita
                                              • Dynamic Exception Reporting in Haskell

                                                Exceptions kind of suck in Haskell. You don’t get a stack trace. They don’t show up in the types of functions. They incorporate a subtyping mechanism that feels more like Java casting than typical Haskell programming. A partial solution to the problem is HasCallStack - that gives us a CallStack which gets attached to error calls. However, it only gets attached to error - so you can either have Str

                                                • CS SYD - JSON Vulnerability in Haskell's Aeson library

                                                  This blogpost describes a DoS vulnerability in Haskell's aeson package. We have followed appropriate procedure for responsible disclosure but the problem was not fixed, so now we are releasing this to the public in the hope that it may still be fixed afterall. Disclaimer: This story is the result of a team effort at FP Complete in 2018. I have received explicit written permission to post it here.

                                                  • Vim and Haskell in 2019

                                                    main :: IO () main = do putStrLn ( "https://github.com/" ++ githubUser ) putStrLn ( "https://twitter.com/" ++ twitterUser ) putStrLn ( "https://linkedin.com/in/" ++ linkedinUser ) putStrLn ( "14D4 0CA1 E1A8 06A0 15C4 A06B 372E C33E B388 121A" ) where twitterUser = "mpmlopes" linkedinUser = "mpmlopes" githubUser = "mlopes" I have recently decided to update my vim configuration for Haskell which had

                                                      Vim and Haskell in 2019
                                                    • Announcing Ema - Static Sites in Haskell

                                                      tldr: Announcing Ema, a new static site generator in Haskell with hot reload destined to develop an unique kind of apps. This post mostly goes over the background of choosing to create it. A little over a year ago I created the rib static site generator in Haskell based on Shake and ghcid. The idea was to be able to write a more intuitive (so no Makefile-like rules) set of instructions for buildin

                                                      • HaskellでOrdインスタンスを書くときの小技3選 - Qiita

                                                        HaskellでOrdインスタンスを手書きする場合の小技を紹介する。 辞書式順序と Ordering 複数のフィールドに対して辞書式比較したい時は、 <> を使うと良い。 例: data Foo = A Int Double Int instance Ord Foo where compare (A x y z) (A x' y' z') = compare x x' <> compare y y' <> compare z z' <> は半群やモノイドの「くっつける」演算子である。最近のGHCでは <> はPreludeからエクスポートされているが、それ以前のGHCでは Data.Semigroup か Data.Monoid をimportする必要がある。 なぜこれでうまくいくのかについては、ググれば出てくる気がするのでそっちを参照。 半群やモノイドについて詳しく知りたい方は、筆者の書

                                                          HaskellでOrdインスタンスを書くときの小技3選 - Qiita
                                                        • HIW 2019で発表された、GHC 8.10に導入されるであろう機能 - Haskell-jp

                                                          前回から引き続き、Haskell Implementors’ Workshop 2019への参加レポートとして、私の印象に残った発表をいくつか紹介します。 今回は、「GHC 8.10に導入されるであろう機能」です。 いずれも該当するMerge Requestはmasterブランチにマージ済みなので、おそらくGHC 8.10で提供されるでしょう。 Link to hereHoleFitPlugins and the future of interactive development in GHC 発表者: Matthías Páll Gissurarson Chalmers University of Technology, Sweden 該当のMerge Request: !153 該当のGHC Proposal: なし 昨年のHaskell Symposiumでも発表されてGHC 8.6

                                                            HIW 2019で発表された、GHC 8.10に導入されるであろう機能 - Haskell-jp
                                                          • GitHub - facebookincubator/retrie: Retrie is a powerful, easy-to-use codemodding tool for Haskell.

                                                            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 - facebookincubator/retrie: Retrie is a powerful, easy-to-use codemodding tool for Haskell.
                                                            • 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
                                                              • 29 Awesome Open-Source Haskell Projects

                                                                In discussions about Haskell, sometimes a question is raised – what exactly can you build with the language? To answer this question, this article will look at some of the more interesting Haskell open-source projects on GitHub. Among them, you will find cool user-facing applications, such as SimpleX and hledger. There’s also plenty of compilers and linters, as well as useful tools and libraries.

                                                                  29 Awesome Open-Source Haskell Projects
                                                                • Making LLVM GEP safer in Haskell

                                                                  In today's article, I will showcase how Haskell's typesystem can be used to simplify code generation and reduce the chance of bugs involving the LLVM getelementptr instruction. Intro to the GEP instruction LLVM as a compiler framework offers many different low-level instructions, one of which being the getelementptr instruction (commonly abbreviated as just "gep"). With gep, you can compute derive

                                                                    Making LLVM GEP safer in Haskell
                                                                  • How Dependent Haskell Can Improve Industry Projects

                                                                    Dependent types are a hot topic in the Haskell community. Many voices advocate for adding dependent types to Haskell, and a lot of effort is being invested towards that end. At the same time, the sceptics raise various concerns, one being that dependent types are more of a research project than a tool applicable in industrial software development. That is, however, a false dichotomy. While depende

                                                                      How Dependent Haskell Can Improve Industry Projects
                                                                    • 関数型言語とは何か?(Haskellで学ぶ)

                                                                      「関数型言語とは何か?」について解説します。「オブジェクト指向の複雑さを軽減する」として関数型言語は近年注目を集めています。しかし「関数を中心にプログラムを組み立てる」といっても、具体的なイメージができない方も多いのではないでしょうか。 本書では「強い制約を課して、本来すべきことに集中する」という視点から関数型言語の概要を紹介します。「変数の値を後から変更できない・副作用を禁止する」など、関数型プログラミングならではの特徴を学んでいきましょう。

                                                                        関数型言語とは何か?(Haskellで学ぶ)
                                                                      • A list of Haskell articles on good design, good testing | William Yao

                                                                        A list of Haskell articles on good design, good testing November 24, 2019 « Previous post Next post » For a language that's beloved for its ability to guide the structure of programs into being easier to understand, easier to maintain, and easier to get correct, there's not a lot of resources on how to best use the tools that Haskell provides. Lots of terms and buzzwords, not a lot of in-depth pra

                                                                        • Haskell Libraries I Love

                                                                          2022-05-29 I just wanted to share some of my favorite Haskell libraries, and why I love them. Most of my projects use most of these libraries. relude: Alternative Prelude More convenient Re-exports common types, type classes, and functions from base, containers, text, bytestring, etc. Types: Text and LText, ByteString and LByteString, etc. Type classes: Alternative, MonadIO, Generic, etc. Function

                                                                          • Error Messages in Haskell, and how to Improve them

                                                                            Main.hs:3:11: error: • No instance for (Num a) arising from a use of ‘+’ Possible fix: add (Num a) to the context of the type signature for: foo :: forall a. a -> a -> a • In the expression: a + b In an equation for ‘foo’: foo a b = a + b | 3 | foo a b = a + b | ^^^^^ On a pure technical level, this is correct. The usage of (+), as a function with type signature (Num a) => a -> a -> a, causes a co

                                                                            • Haskellのループ処理は flip fix でだいたい書けそう - Qiita

                                                                              Haskellにはfor文もwhile文もありません。 大抵の場合はmap, filter, foldrのような関数を使えば事足りますし、再帰関数を使えばほとんどのループ処理は書けてしまいます。しかし時には今考えているループを実装するために適切な高階関数が思いつかなかったり、計算結果だけが欲しいのに再帰関数をわざわざ定義するのが煩わしくなったりする状況もあるでしょう。 "グラフからコミュニティ構造を抽出する 〜リッチフローによるグラフの時間発展〜"を書いた時にいくつかループ処理を実装する必要があって、その度に再帰関数を定義するのが大変だったので flip fix を使いました。そして思ったより flip fix の使い勝手が良かったので、この記事ではこれにスポットライトを当てて紹介したいと思います。

                                                                                Haskellのループ処理は flip fix でだいたい書けそう - Qiita
                                                                              • Haskell - Haskell Fan Site

                                                                                Software engineers are irrepressibly creative. For generations, they have devised programming languages to boldly explore new ways of expressing ideas. But does it matter? Do the new languages help us? While I grew to appreciate certain innovations, I found I profited most from ignoring trends and following well-worn paths established by Lisp programmers decades ago. Weary and wary, I tend to dism

                                                                                • VSCodeのHaskell拡張を使って最速開発環境構築 - Qiita

                                                                                  2020/7/28に新しいHaskell拡張がリリースされました。 https://marketplace.visualstudio.com/items?itemName=haskell.haskell さっそく、こいつを使って最速開発環境構築していくぜ!!! 前提条件 Dockerをインストール VSCodeをインストール Remote - Containers拡張のインストール コンテナ上でHaskell拡張を動作させる 任意のフォルダに.devcontainer.jsonファイルを作成して以下を記載 { "name": "HaskellDevContainer", // DockerhubのHaskell公式イメージ "image": "haskell:8.8", "extensions": [ // HaskellのVSCode拡張をインストール // https://market

                                                                                    VSCodeのHaskell拡張を使って最速開発環境構築 - Qiita