Setting up Haskell on OS X
I’m currently on a mission to get my brain wrapped around functional languages. My guys at work have convinced me that Haskell is the way to go. A group of us have decided to purchase the book “Real World Haskell” and meet regularly to discuss our progress.
As with any new development endeavor, I needed to setup my environment. The Haskell folks make it fairly easy to get things going. Below are the steps I took to get a working ghci (The command-line Haskell interpreter).
- Downloaded the GHC OS X package from here: http://hackage.haskell.org/platform/
- Realized that I hadn’t read the documentation correctly and overlooked the fact that a prerequisite was to have XCode installed. So I hopped over to ADC and grabbed the latest iPhone SDK (which includes the latest XCode).
- That should have basically been it, but since TextMate is my preferred editor on OS X, I sought out a Haskell bundle for it. Much to my chagrin, I would have to kick up my nerd action a step and check out the bundle via Subversion. The current SVN URL for the bundle is: http://svn.textmate.org/trunk/Bundles/Haskell.tmbundle/. It turned out to not be that big of a deal…they have pretty good documentation on the TextMate site. As luck would have it, they used the Haskell bundle as the canonical example (see Section 5.7).
That’s it. Now I can actually get my functional language geek on.
Scott Bale said,
Wrote on June 21, 2009 @ 2:54 pm
Thanks – now I don’t have to figure that all out!
Stuart said,
Wrote on June 22, 2009 @ 2:11 pm
Same steps – the Haskell platform makes everything so convenient now; none of that macports or fink sillyness! (They are useful, of course, but I prefer when I can get properly bundled applications instead)
Minor difference: I use the formidable Aquamacs editor. This already includes a very nice mode for editing Haskell code and also enables you to load up a haskell REPL in a separate buffer. (from here you can load your current working file for live testing and interaction)
Now, I’m just trying to found a nice GUI toolkit – I think wxHaskell might be the current way to go.
Michael Dever said,
Wrote on June 26, 2009 @ 8:30 pm
Heh, wish I’d seen this yesterday, I’ve just rebuilt ghc using port
@stuart – Gtk2hs is probably your safest bet, http://www.haskell.org/gtk2hs – Great documentation and a very helpful mailing list
Steve W said,
Wrote on February 4, 2010 @ 6:38 pm
@Stuart, How do I start a haskell REPL in Aquaemacs?
Thanks