OS X YosemiteにGHC 7.10を入れてVimプラグインを動かすまで

GHC 7.10になったし触ってみようとインストールした時のメモ.

現時点でOSのバージョンは10.10.3.

まず以下のとこからとかでGHC取ってくる.

Haskell for Mac OS X, self-contained relocatable GHC builds

ちなみにbrew cask install ghcで落ちてくる奴はこれ.

ghcformacosxから落としてきた場合, アプリケーション起動すると以下の画面になるので設定する.

f:id:cohalz:20150502165513p:plain

設定したらcabalで必要なもの取ってくる.

cabal update
cabal install happy
cabal install ghc-mod

んだけど,ghc-modで何故かコケる.

調べてみるとissueにもなってるらしく対策があった. github.com

以下のコマンドで入る.

git clone https://github.com/kazu-yamamoto/ghc-mod.git
cd ghc-mod
cabal sandbox init
cabal install
cp .cabal-sandbox/bin/ghc-mod{,i} /usr/local/bin

これでうまくいった.

お次はhoogle.

cabal install hoogle
hoogle data

問題なく行くはず.

ここからVimの設定.

上でsandboxを使ったghc-modだとバージョンが0扱いになっており,

ghc-modを使ったプラグインが低バージョンと判断し無効化されてしまう.

具体的にはneco-ghcとghcmod-vim.

なのでそのプラグインに関してはバージョンチェック機能を切ったものを使う.

NeoBundle 'eagletmt/neco-ghc','master'
NeoBundle 'cohalz/ghcmod-vim'

ちなみにこのghcmod-vimは:GhcModTypeをマッピングしてあり. ノーマルモードでTabを押すと関数名と型を表示する. f:id:cohalz:20150502175215p:plain

これで動いた.

最後に入れてるHaskellプラグイン一覧

NeoBundle 'cohalz/vim2hs'
NeoBundle 'eagletmt/neco-ghc','master'
NeoBundle 'cohalz/ghcmod-vim'
NeoBundle 'kana/vim-filetype-haskell'
NeoBundle 'ujihisa/ref-hoogle'
NeoBundle 'ujihisa/unite-haskellimport'