Category Archives: haskell

Themes on Streams, Part II

In a previous post I claimed that comonad structures on R -> a are in one-to-one correspondence with monoid structures on R. In this post and the next I’ll justify that claim. Characterizing comonads on R -> a Suppose we … Continue reading

Posted in haskell, math | Tagged , , , , | 2 Comments

Tic-tac-toe maps with diagrams

Inspired by Randall Munroe, here are some handy guides to optimal tic-tac-toe play, created with the diagrams EDSL. Click the images to open (zoomable) PDF versions. I hacked this up in just a few hours. How did I do it? … Continue reading

Posted in haskell, projects | Tagged , , , , | 12 Comments

Announcing diagrams preview release

I am extremely pleased to announce a "developer preview" release of the diagrams framework for declarative drawing. This is a well-thought-out, well-documented, working release with all core functionality in place, but with many planned features still missing (for example, support … Continue reading

Posted in haskell, projects | Tagged , , , , , | 7 Comments

trapd

Posted in haskell, humor | Tagged , , , , | 4 Comments

Themes on Streams

> {-# LANGUAGE DeriveFunctor, FlexibleInstances #-} Recall that a stream is a countably infinite sequence of values: > data Stream a = a :> Stream a > deriving (Functor, Show) > > sHead (a :> _) = a > sTail … Continue reading

Posted in haskell, math | Tagged , , , , , | 3 Comments

Monoids for Maybe

The other day I had two lists of monoidal values that I wanted to combine in a certain way, and I realized it was an instance of this more general pattern: > {-# LANGUAGE GeneralizedNewtypeDeriving #-} > import Data.Monoid > … Continue reading

Posted in haskell | Tagged , , , | 8 Comments

Call for contributions: second edition of the Typeclassopedia

The Typeclassopedia, by all accounts, has turned out to be a popular and useful resource for Haskell programmers. I’ve been thinking for a while about putting out a revised and expanded second edition, and it’s finally time. Planned changes include: … Continue reading

Posted in haskell, writing | Tagged , , , , | 17 Comments

Binders Unbound

Stephanie Weirich, Tim Sheard and I recently submitted a paper to ICFP entitled Binders Unbound. (You can read a draft here.) It’s about our kick-ass, I mean, expressive and flexible library, unbound (note: GHC 7 required), for generically dealing with … Continue reading

Posted in grad school, haskell, projects, writing | Tagged , , , , , | 7 Comments

Enumerating linear inhabitants

This is post number four in an ongoing series (#1, #2, #3) exploring the combinatorics of linear lambda calculus. In this literate Haskell post, I exhibit some code for enumerating all possible linear inhabitants of a given type, making use … Continue reading

Posted in haskell | 1 Comment

Math.OEIS needs a new maintainer

Summary: the OEIS has switched servers and the oeis package needs updating to match, so I’m looking for someone to take over development. All the rest is padding in the form of entertaining stories. Recently, Michael Snoyman’s wonderful packdeps tool … Continue reading

Posted in haskell, math, projects | Tagged , , , , | 4 Comments