# Why I Support the Haskell Foundation

Last November at the Haskell eXchange conference, Simon Peyton Jones announced the Haskell Foundation. This can be understood as many things: an organization dedicated to the hard work of making Haskell more successful and useful, a touchpoint for different parts of the Haskell community to come together and cooperate, and a focus knob to direct general support (financial and otherwise) for the Haskell community and maximize its impact.

I recently decided to become a major contributor to the Haskell Foundation, and I’m writing about the reasons behind my decision. I also hope to encourage others who can easily do so…

# Fun with Category Theory and Dynamical Systems

I have always loved finding those parts of mathematics where big ideas just pop out almost by accident, appearing fully formed in a surprising and delightful way. Who, for example, could fail to marvel at how topology manages to capture so many unique and striking meanings into words like continuous which can mean very different things just by choosing a different topology in which to interpret the same definition?

Something like this happens in categories by considering limits and colimits. One simply draws a simple picture, follows a simple set of rules, and important ideas pop out. …

# Gibbard’s Theorem vs Stable Matching

Here are two theorems from game theory, which initially seem to contradict each other. By comparing them, we can uncover some hidden nuance in the situation.

## Gibbard’s Theorem: Strategy is Inevitable

The first theorem, initially by Allan Gibbard and generalized by later work by Gibbard and others, showed that any collective decision-making process must have one of three properties:

1. There are only two possible outcomes.
2. There is a dictator, who can choose the outcome regardless of any choices made by anyone else.
3. It is strategic, meaning that the best way to get what you want depends not just on your preferred outcome but also on…

# Overview

In this article, we’ll develop a Haskell library for continued fractions. Continued fractions are a different representation for real numbers, besides the fractions and decimals we all learned about in grade school. In the process, we’ll build correct and performant software using ideas that are central to the Haskell programming language community: equational reasoning, property testing, and term rewriting.

I posted an early version of this article to Reddit, and I’m grateful to those who responded with insight and questions that helped me complete this journey, especially iggybibi and lpsmith.

# The Logarithm of a Sum

This is the story of an interesting flight of fancy with mathematics. I found it intriguing, and hope you do, as well.

## The question

Here’s a fact that comes up in high school mathematics: you can demote multiplication into addition by using logarithms. That is:

That is, you can compute the log of a product, given only the logs of the factors.

To students today, this might seem like just another algebraic identity. But in the age before calculators, it was actually the main reason for a typical high school student to be interested in logarithms at all! Multiplication is more difficult…

Quadratic expressions are the first category of non-linear expressions that algebra students typically study in detail. How do you motivate quadratics as an interesting object of study?

There are a few answers to this question. For example:

• Khan Academy starts with parabolas. After a hint that the shape of a parabola has to do with ballistics and the path of a thrown object, they go on to describe the shape of the graph in detail, including the vertex, the axis of symmetry, and the x and y intercepts.
• EngageNY starts with algebraic techniques. Specifically, it is concerned with distributing and…

# Using client-side Haskell web frameworks in CodeWorld

I’ve made another change to make the CodeWorld environment more useful for general Haskell programming.

# What?

Here is the calculator from https://reflex-frp.org/tutorial:

Here is the calculator running inside CodeWorld:

You can also use Miso from CodeWorld:

You can even build your own HTML with ghcjs-dom, jsaddle, or even just the JavaScript FFI. For example, here’s how you can incorporate the diagrams library into CodeWorld:

I’d love to add anything else that’s useful. The framework must be usable in an otherwise blank page, so frameworks that expect lost of preexisting HTML, CSS, images, etc. won’t work out so well. If you would…

# A mystery about graphs and matrices

This is the story of a question I’ve been pondering off and on for about a decade now. I’m writing this down mostly because it makes for some enjoyable pondering, but it would be nice if someone has an interesting answer that I’ve missed.

# Definitions

For the purposes of this post, when I say “graph”, I’m going to mean a finite directed graph, which is allowed to have multiple parallel edges and self-loops (edges from a vertex back to itself). …

# Toy Machine Learning with Haskell

In this post, I show how you can use Haskell and the `ad` package (automatic differentiation) to build a toy machine learning model in Haskell. I’ve tried to write enough that someone without a machine learning background can follow the code. If you do have an ML background, just skim those parts!

I’m going to try something different. Instead of writing in Medium, I’ve written up this post in comments inside of CodeWorld.

# Part 1: Model Structure

In this part, I explain what a machine learning model is, define the Haskell types for the parts of the model, and write the code to make…

# CodeWorld as a Haskell Playground: Call for Package Requests

Lately, I’ve been thinking more about beefing up CodeWorld as an easy playground for sharing running Haskell code examples. The platform makes it easy to write Haskell code in any web browser without setting up anything on your machine, and to share this code by a unique URL through any medium such as Twitter, IRC, etc. and make it easy for others to tinker with them in turn.

To further this goal, I am formalizing the list of Haskell packages that I can guarantee to be available in the environment. The current list is available here.

My question: What else…

## Chris Smith

Software engineer at Facebook, volunteer math and computer science teacher, author of the CodeWorld platform, amateur ring theorist, and Haskell enthusiast.

Get the Medium app