Difference between revisions of "Mac OS X"

From HaskellWiki
Jump to navigation Jump to search
Line 12: Line 12:
   
 
* Install the [http://hackage.haskell.org/platform/ Haskell Platform]
 
* Install the [http://hackage.haskell.org/platform/ Haskell Platform]
 
* Open <code>/Library/Frameworks/GHC.framework/Versions/Current/usr/bin/ghc-6.10.4</code> in a text editor
* You will need to patch just this file:
 
 
* Insert <code>-optc-m32 -opta-m32 -optl-m32</code> just before the last parameter.
** /Library/Frameworks/GHC.framework/Versions/Current/usr/bin/ghc-6.10.4
 
* Insert <code>-optc-m32 -opta-m32 -optl-m32</code> just before the last parameter. The last line in that file is rather long, and should now end like:
 
** <code> -dynload wrapped -optc-m32 -opta-m32 -optl-m32 ${1+"$@"}</code>
 
* P.S.: If you have a different version of GHC than 6.10.4, then adjust the file name appropriately.
 
* P.P.S.: Don't be tempted to just put an edited local copy of the script in ~/bin/ghc, or edit all the various GHC files in /usr/bin. There is a maze of twisty symlinks that all eventually lead to the above script, and fixing just it is far simpler.
 
   
 
The last line in that file is rather long, and should now end like <code> -dynload wrapped -optc-m32 -opta-m32 -optl-m32 ${1+"$@"}</code>
  +
 
Don't be tempted to just put an edited local copy of the script in ~/bin/ghc, or edit all the various GHC files in /usr/bin. There is a maze of twisty symlinks that all eventually lead to the above script, and fixing just it is far simpler.
   
 
See also [http://passingcuriosity.com/2009/haskell-on-snow-leopard/ Haskell on Snow Leopard].
 
See also [http://passingcuriosity.com/2009/haskell-on-snow-leopard/ Haskell on Snow Leopard].

Revision as of 08:01, 23 November 2009

GHC

Mac OS X 10.5 (Leopard)

To install GHC on Mac OS X 10.5 (Leopard), there are the following options:

Mac OS X 10.6 (Snow Leopard)

Mac OS X 10.6.x (Snow Leopard) works with GHC, after you apply a simple patch. The problem is that GHC generates 32bit code, but gcc on Snow Leopard defaults to 64bit code on machines with processors that support it. The patch simply tells GHC to tell gcc work in 32bit:

  • Install the Haskell Platform
  • Open /Library/Frameworks/GHC.framework/Versions/Current/usr/bin/ghc-6.10.4 in a text editor
  • Insert -optc-m32 -opta-m32 -optl-m32 just before the last parameter.

The last line in that file is rather long, and should now end like -dynload wrapped -optc-m32 -opta-m32 -optl-m32 ${1+"$@"}

Don't be tempted to just put an edited local copy of the script in ~/bin/ghc, or edit all the various GHC files in /usr/bin. There is a maze of twisty symlinks that all eventually lead to the above script, and fixing just it is far simpler.

See also Haskell on Snow Leopard.

To uninstall ghc call:

sudo /Library/Frameworks/GHC.framework/Tools/Uninstaller

HUGS

Editors with Haskell support

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

Commercial

SubEthaEdit:

SubEthaEdit.png

TextMate:

TextMate.png

and Smultron:

Smultron.png

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.

Shipping Installable Haskell Applications

  • mkbndl builds installable Mac OSX applications from your Haskell project.

Links