Clojure Gazette 1.87

Haskell Deep Dive

Clojure Gazette

Issue 1.87August 03, 2014


Hello curious programmers,

One of the things I like most about the Clojure community is our love of good ideas. Clojure collects new perspectives and they enrich the language and programmers who use it.

Following that theme, this week, I went deep into Haskell, looking for what makes it special and relevant today. Haskell is purely functional at its core. **While Clojure builds functional idioms on top of imperative constructs (do forms, etc.), Haskell builds imperative constructs out of pure, immutable values. ** And of course, Haskell is statically typed.

Haskell is well-worth learning and playing with. You will learn a lot, and I hope it will make your Clojure code better :)

Eric Normand

PS Learn more about the Clojure Gazette and subscribe.

Sponsor: Brick Alloy

Thanks to the very first sponsor, Brick Alloy. Brick Alloy is a band of senior consultants that solve really hard scalability and security problems. These are the people behind the Lift web framework for Scala, which is the most secure web framework out there. They help you with the whole stack, from the user experience down to the scaling infrastructure.

They also support lots of Clojure-related things you've heard of: ClojureBridge, Typed Clojure, and Clojure/West, among others. They have a very interesting organization: it's more like a law firm where everyone brings in clients and they share in successes. Check out their team and say hi on Twitter.

A History of Haskell:Being Lazy With Class

If you've ever wondered where Haskell came from, who was important in its development, or what their motivations were, this is the paper to read. DISCUSS

Why Functional Programming Matters

A great read about the potentials of functional programming to solve the issues that we have with complex software. DISCUSS

Algorithm W Step By Step

You can't really talk about Haskell without mentioning types. Algorithm W is an implementation of Hindley-Milner, which is the basis for Haskell's type inference engine. This paper contains a very clear implementation (in Haskell) of a type inferencer. A Clojure implementation using this paper exists. DISCUSS

Imperative functional programming

This is the paper that introduced the IO monad. Enough said. DISCUSS

How to make ad hoc polymorphism less ad hoc

A very readable paper introducing Haskell's type classes. DISCUSS

Hoogle and Hayoo!

Haskell has two search engines, appropriately called Hoogle and Hayoo!. Writing in Haskell, you'll inevitably want to convert a value of one type to a value of another type. Or you'll remember the type signature of a function but not its name. Hoogle and Hayoo! let you search for functions based on their type signature. Can't remember how to parse a String as an Int? Search for "String -> Int" and it will find it. DISCUSS

Haskell Cheat Sheet

If you're learning Haskell, it's nice to have a quick guide to all of the syntax. When I was programming Haskell professionally, I would refer to it a lot. This one is a little long but it is comprehensive and explains each bit of syntax with a short paragraph. DISCUSS

Try Haskell

A Haskell REPL in your browser. DISCUSS

Haskell Type Checker

A Haskell type checker in your browser. It comes preloaded with some type puzzles to solve. If the type checker passes, you solved the puzzle! DISCUSS

School of Haskell

Tons of learning material (mostly tutorials) for Haskell. It's such a well-organized and diverse site. We should have something like this for Clojure. DISCUSS

Running a Startup on Haskell

One of the early pioneers in practical Haskell programming, Bryan O'Sullivan developed a lot of tools and libraries that address the more pragmatic and business side of Haskell. This talk covers a lot of his experience. There are slides . DISCUSS

Escape from the Ivory Tower

Simon Peyton Jones talks about the history of Haskell. What's particularly important is his understanding of the pain of working with statically typed languages. There is a set of programs that you want to write but that the compiler doesn't understand. Haskell has, over its more than 20 year history, slowly chipped away at that set of programs, making the language more expressive while never compromising its core purity. The goal is to make that area so small that people will never want nor need to use a dynamically typed language. I welcome that time, though I think it is far away. DISCUSS

Faith, Evolution, and Programming Languages

An issue about Haskell would not be complete without a talk by Philip Wadler. This talk is hard to summarize, but what I like most about it is the explanation of the correspondences between strongly typed lambda calculus and logic. This is the kind of stuff that typed languages can get into. DISCUSS