サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
CES 2025
www.haskellforall.com
This post introduces some tricks for jailbreaking hosts behind “secure” enterprise firewalls in order to enable arbitrary inbound and outbound requests over any protocol. You’ll probably find the tricks outlined in the post useful if you need to deploy software in a hostile networking environment. The motivation for these tricks is that you might be a vendor that sells software that runs in a cust
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
In this post I hope to explain why bidirectional type-checking has a lot of cultural cachet within the programming language theory community. To be clear, I’m an amateur and I have no formal background in computer science or type theory. Nonetheless, I believe I’ve learned enough and compared notes with others to motivate bidirectional type-checking. Subtyping The fundamental problem that bidirect
This is an announcement post for my “Grace browser” project, which you can find here: trygrace.dev This project is a web page which can dynamically convert a wide variety of functional programming expressions to their equivalent HTML. This conversion can even auto-generate interactive web forms from functions, which means that people without web programming knowledge can use the Grace browser to c
This post briefly tours resources that helped introduce me to type theory, because I’m frequently asked by others for resources on this subject (even though I never had a formal education in type theory). Specifically, these resources will focus more on how to implement a type checker or type inference algorithm. Also, my post will be biased against books, because I don’t tend to learn well from r
This post illustrates a trick that I’ve taught a few times to minimize the “change surface” of a Haskell program. By “change surface” I mean the number of places Haskell code needs to be updated when adding a new feature. The motivation I’ll motivate the trick through the following example code for a simple REPL: import Control.Applicative ((<|>)) import Data.Void (Void) import Text.Megaparsec (Pa
This post documents my favorite lens trick of all time. Also, this trick works for any optics package based on van Laarhoven lenses, like lens-family-core or microlens. This post assumes some familiarity with lenses, so if you are new to lenses then you might want to first read: Control.Lens.Tutorial The title is slightly misleading and the precise statement is that Folds are Monoids, and all of t
The visitor pattern is essentially the same thing as Church encoding This post explains how the visitor pattern is essentially the same thing as Church encoding (or Böhm-Berarducci encoding). This post also explains how you can usefully employ the visitor pattern / Church encoding / Böhm-Berarducci encoding to expand your programming toolbox. Background Church encoding is named after Alonzo Church
This post explains why I stick with functional programming, using a rationale that a non-functional programmer can relate to. The reason is actually pretty simple: functional programming idioms are more enduring and portable than idioms from other programming paradigms (such as procedural or object-oriented programming). To explain why, I need to first define what I understand “functional programm
This post summarizes a rule of thumb that I commonly cite in software quality discussions, so that I can link to my own post to save time. I have taken to calling this the “golden rule of software quality” because the rule is succinct and generalizable. The golden rule is: Prefer to push fixes upstream instead of working around problems downstream … and I’ll explain implications of this rule for a
This is a short post documenting various record-related idioms in the Haskell ecosystem. First-time package users can use this post to better understand record API idioms they encounter in the wild. For package authors, I also include a brief recommendation near the end of the post explaining which idiom I personally prefer. The example I’ll use the following record type as the running example for
This post illustrates a nifty application of Haskell’s standard library to solve a numeric problem. The Fibonacci series is a well-known sequence of numbers defined by the following rules: In fact, that’s not only a specification of the Fibonacci numbers: that’s also valid Haskell code (with a few gratuitous parentheses to resemble traditional mathematical notation). However, that solution is inef
The Dhall configuration language is now three years old and this post reviews progress in 2019 and the future direction of the language in 2020. If you’re not familiar with Dhall, you might want to visit the official website for the language. This post assumes familiarity and interest in the language. I would like to use this post to advertise a short survey you can take if you would like to provi
This post briefly explains why I commonly suggest that people replace error with fail when raising IOExceptions. The main difference between error and fail can be summarized by the following equations: In other words, any attempt to evaluate an expression that is an error will raise the error. Evaluating an expression that is a fail does not raise the error or trigger any side effects. Why does th
This post walks through the development of a small Haskell program for aligning equals symbols in a block of text. This walkthrough targets a beginning programmer by describing several steps and concepts in extra detail. Note that this post describes how to author, compile, and run single-file Haskell programs for ease of experimentation and learning. For larger Haskell projects you will want to u
This post summarizes the rough heuristics that I use for evaluating Haskell packages. Usually I use these rules of thumb when: choosing between multiple similar packages deciding whether to depend on a package at all Some of these guidelines work for other programming languages, too, but some of them are unique to Haskell. Even if you are a veteran programmer in another language you still might fi
Recent versions of GHC 8.0 provides a Monoid instance for IO and this post gives a motivating example for why this instance is useful by building combinable "wizard"s. Wizards I'll define a "wizard" as a program that prompts a user "up front" for multiple inputs and then performs several actions after all input has been collected. Here is an example of a simple wizard: main :: IO () main = do -- F
The Dhall programmable configuration language is now one year old and this post will review progress over the last year and the future direction of the language in 2018. If you're not familiar with Dhall, you might want to visit the official GitHub project which is the recommended starting point. This post assumes familiarity with the Dhall language. Also, I want to use this post to advertise a sh
Semantic integrity checks are the next generation of semantic versioning The Dhall configuration language just added support for "semantic integrity checks". This post explains what "semantic integrity check" means, motivates the new feature, and compares to semantic versioning. The problem I added this feature in response to user concerns about code injection in Dhall configuration files. We'll i
This post summarizes advice that I frequently give to Haskell beginners asking how to start out learning the language First, in general I recommend reading the Haskell Programming from first principles book, mainly because the book teaches Haskell without leaving out details and also provides plenty of exercises to test your understanding. This is usually good enough if you are learning Haskell as
I was recently trying to optimize Dhall's performance because the interpreter was performing poorly on some simple examples. For example, consider this tiny expression that prints 3000 exclamation marks: The above Dhall expression takes over 14 seconds to evaluate to normal form, which is not acceptable: $ bench 'dhall <<< './exclaim' benchmarking dhall <<< ./exclaim time 14.42 s (14.23 s .. 14.57
Recently I translated Nix's derivation parser to Haskell and I thought this would make an instructive example for how C++ idioms map to Haskell idioms. This post targets people who understand Haskell's basic syntax but perhaps have difficulty translating imperative style to a functional style. I will also throw in some benchmarks at the end, too, comparing Haskell performance to C++. Nix derivatio
This post will explain the connection between programming languages and logical proofs, known as the Curry-Howard correspondence. I will provide several examples of this correspondence to help you build a working intuition for how these two fields relate to one another. The Curry-Howard correspondence states that: Logical propositions correspond to programming types Logical proofs correspond to pr
I'm releasing a new configuration language named Dhall with Haskell bindings. Even if you don't use Haskell you might still find this language interesting. This language started out as an experiment to answer common objections to programmable configuration files. Almost all of these objections are, at their root, criticisms of Turing-completeness. For example, people commonly object that configura
Currently, Hackage has four implementations of "ListT-done-right" that I'm aware of: LogicT pipes (which provides a ListT type) list-t List However, I felt that all of these libraries were more complex than they needed to be so I tried to distill them down to the simplest library possible. I want to encourage more people to use ListT so I'm releasing the beginner-friendly list-transformer library
The title of this post is a play on the Lisp aphorism: "Code is Data". In the Lisp world everything is data; code is just another data structure that you can manipulate and transform. However, you can also go to the exact opposite extreme: "Data is Code"! You can make everything into code and implement data structures in terms of code. You might wonder what that even means: how can you write any c
In this post I hope to persuade you that Haskell is well-adapted to software engineering in the large. To motivate this post, I would like to begin with a simple thought experiment. Suppose that we could measure short-term programmer productivity for two hypothetical programming languages named "X" and "Y". In practice, we cannot easily compare productivity between two programming languages, but j
I'm releasing the optparse-generic library which uses Haskell's support for generic programming to auto-generate command-line interfaces for a wide variety of types. For example, suppose that you define a record with two fields:
Six months ago I released the first "State of the Haskell Ecosystem", a collaborative wiki documenting the maturity of the Haskell language for various application domains: State of the Haskell Ecosystem The primary goals of this wiki are to: Advertise what areas the Haskell language and ecosystem excel at Warn newcomers about common pitfalls so they avoid unpleasant surprises Give new contributor
次のページ
このページを最初にブックマークしてみませんか?
『Haskell for all』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く