並び順

ブックマーク数

期間指定

  • から
  • まで

41 - 56 件 / 56件

新着順 人気順

haskellの検索結果41 - 56 件 / 56件

  • 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
    • 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の新機能
      • Haskellのzip関数を一般化すると何になるか

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

          Haskellのzip関数を一般化すると何になるか
        • 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"
          • 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

              • 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

                • About this book - Learn Haskell by building a blog generator

                  About this book Looking for reviews and mentions? Click here. In this book, we will implement a simple static blog generator in Haskell, converting documents written in our own custom markup language to HTML. We will: Implement a tiny HTML printer library Define and parse our own custom markup language Read files and glue things together Add command line arguments parsing Write tests and documenta

                    About this book - Learn Haskell by building a blog generator
                  • 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

                    • C#でエラー処理を実装するときにEither型を作ったら良い感じになった

                      要約 処理に失敗したことをメソッドの呼び出し元に通知するのに例外を使いたくなかった とはいえTupleでエラーオブジェクトを返すのもなんか取り回しが悪い そこで「2つの型のどちらかが設定されている」を保証するEither型を実装したらめちゃくちゃ書きやすくなった 背景 おそらくC#において「メソッドの処理が失敗した」ことを呼び出し元に通知する一番メジャーな方法は例外オブジェクトを投げる方法だと思います(標準ライブラリの多くがそうやってエラーを通知しています)。 しかし例外を投げるように実装すると、例外は分岐が見えにくく追いかけるのが面倒だし、呼び出し側でtry~catchをいちいち書くのが面倒だし、キャッチが漏れた例外がそのまま上に突き抜けたりとか、色々な問題を孕んでいます。 また、メソッドが例外を投げることがメソッドのシグネチャで表現されないので、あるメソッドを呼び出したときに例外をキャ

                        C#でエラー処理を実装するときにEither型を作ったら良い感じになった
                      • λ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?
                        • 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)
                          • 『なっとく!関数型プログラミング』はScalaで説明されている本だけど読んだらHaskellのdoもわかるようになった - nakaoka3の技術ブログ

                            関数型プログラミング言語については、以前にHaskellの本を読んでみたりして、興味はあったのだが正直あまり理解できてなかった。 『なっとく!関数型プログラミング』はScalaのコードで関数型プログラミングを説明している本だ。最近邦訳が発売されて話題になっていたので買って読んでみた。 www.seshop.com この本で入れ子のflatMap の説明から、Scalaの for 内包表記 を説明しているところを読んで、Haskell の do もこれかということに気がついた。 リストの場合 // 入れ子のflatMap val result = List(1, 2).flatMap { x => List(10, 20).flatMap { y => List(100, 200).map { z => x + y + z } } } // for内包表記 val result2 = for

                              『なっとく!関数型プログラミング』はScalaで説明されている本だけど読んだらHaskellのdoもわかるようになった - nakaoka3の技術ブログ
                            • 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
                              • 継続モナドで立ち向かうローンパターンと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地獄 - 星にゃーんのブログ
                                • 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