Skip to content

Instantly share code, notes, and snippets.

@edwardw
edwardw / ablog.md
Created July 6, 2011 05:22
Parallel programming in Haskell

Simon Peyton Jones gave a talk on parallel programming in Haskell. A must to watch: http://skillsmatter.com/podcast/scala/talk-by-haskell-expert-simon-peyton-jones/js-1434

His notion of task, semi-implicit and data parallelism is very inspiring. And here are things interest me the most from his talk (in no particular order):

  • Erlang-style messaging in Haskell (cloud haskell)
  • parMap, a.k.a Control.Parallel.Strategies
  • Data.Array.Repa
  • Data.Array.Accelerate, i.e. GPU in Haskell

Both Repa and Accelerate come from Manuel Chakravarty. His homepage: http://www.cse.unsw.edu.au/~chak/

@edwardw
edwardw / ablog.md
Created July 3, 2011 08:58
Haskell operator section

In this wonderful tutorial "Write Yourself a Scheme in 48 Hours", this line puzzles me for a while:

apply :: String -> [LispVal] -> LispVal
apply func args = maybe (Bool False) ($ args) $ lookup func primitives

What does ($ args) really mean? Turns out it is called operator section, a special syntax which LYSH fails to mention. This thread did a great job on explaining it:

http://www.haskell.org/pipermail/beginners/2009-January/000776.html

@edwardw
edwardw / blog.md
Created June 27, 2011 15:50
Haskell surprised me again

This time it is case expression. I was looking for a way in haskell to define constants so I wrote this:

one = 1
two = 2
three = 3

which n =
  case n of
 one -> "one"
@edwardw
edwardw / gist:1046499
Created June 25, 2011 13:39
Recipe to install System.Console.Readline hackage on Snow Leopard

Following works for me:

$ brew install readline
$ cabal install readline --configure-option=--with-readline-includes=/usr/local/Cellar/readline/6.2.1/include --configure-option=--with-readline-libraries=/usr/local/Cellar/readline/6.2.1/lib