Mac OS X
From HaskellWiki
(→Mac OS X 10.6 (Snow Leopard): simplify) |
m |
||
| Line 11: | Line 11: | ||
==== Important notes ==== | ==== Important notes ==== | ||
| - | To get the most out of your GHC environment, you should '~/.cabal/bin' to your PATH environment variable before the path where you have GHC installed. This will allow you to get and use cabal-updates, as well as other programs shipped with GHC like hsc2hs. | + | To get the most out of your GHC environment, you should add '~/.cabal/bin' to your PATH environment variable before the path where you have GHC installed. This will allow you to get and use cabal-updates, as well as other programs shipped with GHC like hsc2hs. |
| - | In | + | In your ~/.profile, add the line: |
<code>export PATH="~/.cabal/bin:$PATH";</code> | <code>export PATH="~/.cabal/bin:$PATH";</code> | ||
Revision as of 23:25, 4 October 2010
There is also now the Mac OS X Strike Force that aims to improve using Haskell on OS X.
Contents |
1 The Haskell Platform
There are Mac OS X installers of the full Haskell Platform development environment. We recommend it:
2 GHC
2.1 Important notes
To get the most out of your GHC environment, you should add '~/.cabal/bin' to your PATH environment variable before the path where you have GHC installed. This will allow you to get and use cabal-updates, as well as other programs shipped with GHC like hsc2hs.
In your ~/.profile, add the line:
export PATH="~/.cabal/bin:$PATH";
2.2 Mac OS X 10.5 (Leopard)
To install GHC on Mac OS X 10.5 (Leopard), there are the following options:
- install the Haskell Platform
- install MacPort's ghc package
2.3 Mac OS X 10.6 (Snow Leopard)
- Install the Haskell Platform
To uninstall ghc call:
sudo /Library/Frameworks/GHC.framework/Tools/Uninstaller
3 HUGS
4 Installing libraries with external C bindings
Haskell libraries are installed with the cabal command line tool.
Some libraries depend on external C libraries, which are best installed with MacPorts. However, you have to tell cabal to include the /opt/local/ directories when searching for external libraries. The following shell script does that by wrapping the cabal utility
> cat cabal-macports
#!/bin/bash
export CPPFLAGS=-I/opt/local/include
export LDFLAGS=-L/opt/local/lib
cabal $@ --extra-include-dirs=/opt/local/include \
--extra-lib-dirs=/opt/local/lib
> cabal-macports install foobar
5 Editors with Haskell support
5.1 Open Source
- AquaMacs, a graphical Emacs version
- Eclipse with the EclipseFP plugin
- Emacs, is installed on every Mac
- Leksah
- MacVim, a graphical Vim version
- Vim, is installed on every Mac
- Yi (written in Haskell itself!), is available through cabal-install
5.2 Commercial
and Smultron:
TextEdit is Mac's default text editor, a very basic editor that works fine for most uses, you must however be careful to put it into plain text mode using the Format menu.
6 Shipping Installable Haskell Applications
- mkbndl builds installable Mac OSX applications from your Haskell project.
7 Links
- Using Haskell in an Xcode Cocoa project; a description of how to add a Haskell module (callable from C) to an Xcode/Cocoa/Interface builder project on your Mac.
- Mac OS X Common Installation Paths: an effort to standardize where things go on a Mac OS X installation



