Emacs と cabal-install の設定
Real World Haskell - 第1章 - バイナリアンを目指して
GHC 6.10.1をWindows XP にインストールした。
さらに Emacs と cabal-install を設定した。
Emacs
- ftp://ftp.gnu.org/gnu/emacs/windows/ から emacs-22.3-bin-i386.zip をダウンロードして解凍
- 解凍してできた emacs-22.3 フォルダを C:\Program Files に移動
- Emacs Lisp packages から haskell-mode-2.4.tar.gz をダウンロードして解凍
- haskell-mode-2.4 フォルダを C:\haskell に移動 (パスを合わせれば場所は任意)
- C:\Documents and Settings\user_name\Application Data\_emacs ファイルを作成
(load "c:/haskell/haskell-mode-2.4/haskell-site-file") (add-hook 'haskell-mode-hook 'turn-on-haskell-decl-scan) (add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode) (add-hook 'haskell-mode-hook 'turn-on-haskell-indent) (setq inferior-haskell-find-project-root nil) (add-hook 'inferior-haskell-hook (function (lambda () (set-buffer-file-coding-system 'utf-8) (set-buffer-process-coding-system 'utf-8 'utf-8))))
runemacs.exe を起動し、haskell のプログラムを開いた状態で C-c C-l すると GHCi が起動できる。
cabal-install で UTF8 環境を構築
- HTTP library をダウンロードして解凍
- zlib library をダウンロードして解凍
- cabal-install program をダウンロードして解凍
- コマンドプロンプトで解凍した各フォルダに移動して以下を実行 (依存関係があるので cabal は最後に処理)
- runghc Setup configure
- runghc Setup build
- runghc Setup install
- cabal update
- cabal install utf8-string
これで日本語が表示できる。
System.IO.UTF8.putStrLn "日本語"
Hackage のリストはこちら