Functional pearl on combinatorial species

I’ve just submitted a Functional Pearl to ICFP explaining combinatorial species in a way that is (hopefully) accessible and interesting to functional programmers. You can read the draft here — as always, comments, suggestions, etc. are welcome (although it’s too late to help my ICFP chances =).

I plan to upload a new version of my species library soon with a ton of major improvements (unlabelled enumeration, and automatically deriving species corresponding to user-defined data types via Template Haskell, to name a couple). When I do I’ll be sure to write about it here!

Also, the paper doesn’t mention it, but all the diagrams in the paper were of course generated with diagrams.

About Brent

Assistant Professor of Computer Science at Hendrix College. Functional programmer, mathematician, teacher, pianist, follower of Jesus.
This entry was posted in combinatorics, haskell, writing and tagged , , . Bookmark the permalink.

3 Responses to Functional pearl on combinatorial species

  1. eruonna says:

    I don’t understand why fmap and enumerate for Zero must be undefined. Couldn’t you have fmap _ = id and enumerate _ = [] ? The fmap seems to be mostly philosophical, since you’ll never find anything to apply it to, but don’t you need to define enumerate in order to use Zero in sums?

    • Brent says:

      Ah, thanks, you’re absolutely right, enumerate for Zero ought to be enumerate _ = []. That’s what I get for not actually running the code!

  2. Pingback: blog :: Brent -> [String]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.