読者です 読者をやめる 読者になる 読者になる

IT練習ノート

IT関連で調べたこと(実際は嵌ったこと)を書いています。

AWSにhaskell環境構築

Haskell開発環境構築

vimでコーディングがしやすいようにプラグインを入れてみる。毎度のことながら嵌りましたねぇ。

感想などなど

  • cabal等を使っているものの、各種モジュールの依存関係で手こずる。
  • 各種インストールはblog等のweb情報を参考にしつつも、モジュール本家のインストールドキュメントをまず読んだ方さそう。
  • Haskellの各種モジュールのコンパイルをするときにはEC2のmicrインスタンスだとパワー不足かも。
  • :GhcModCheck, :GhcModLintはvimで保存しておかないと実行されない(当たり前か、、)。
  • :GhcModCheckでモジュール定義をしておかないとmainに定義していると警告されるので使い捨てコードを書くときちょっと面倒。
  • :GhcModLintで指摘される内容に従うと、コードが簡素になる。
  • :GhcModTypeは、コード読むときに使える。ただ、自分でコードを書いているときは、使わなそう。
  • 困ったときはStackOverflowを検索するのが良さそう。

vimの設定ファイルは次のようにしました。(キーバインドはまだ定義してないです。)

  1 set number "行番号を表示する
  2 set title "編集中のファイル名を表示
  3 set showmatch "括弧入力時の対応する括弧を表示
  4 syntax on "コードの色分け
  5 
  6 ''
  7 if has('vim_starting')
  8   set nocompatible               " Be iMproved
  9 
 10   " Required:
 11   set runtimepath+=~/.vim/bundle/neobundle.vim/
 12 endif
 13 
 14 " Required:
 15 call neobundle#rc(expand('~/.vim/bundle/'))
 16 
 17 " Let NeoBundle manage NeoBundle
 18 " Required:
 19 NeoBundleFetch 'Shougo/neobundle.vim'
 20 
 21 " My Bundles here:
 22 NeoBundle 'dag/vim2hs'
 23 NeoBundle 'eagletmt/ghcmod-vim'
 24 NeoBundle 'Shougo/vimproc'
 25 
 26 " You can specify revision/branch/tag.
 27 
 28 " Required:
 29 filetype plugin indent on
 30 
 31 " If there are uninstalled bundles found on startup,
 32 " this will conveniently prompt you to install them.
 33 NeoBundleCheck

インストールのログ

vimのバージョン確認

[ec2-user@ip-XXX-XX-XX-XXX ~]$ vim

gitのインストール

[ec2-user@ip-XXX-XX-XX-XXX ~]$ git
-bash: git: コマンドが見つかりません
[ec2-user@ip-XXX-XX-XX-XXX ~]$ sudo yum install git
読み込んだプラグイン:priorities, update-motd, upgrade-helper
amzn-main/latest                                                                                                                                       | 2.1 kB     00:00     
amzn-updates/latest                                                                                                                                    | 2.3 kB     00:00     
依存性の解決をしています
--> トランザクションの確認を実行しています。
---> パッケージ git.x86_64 0:1.8.3.1-1.28.amzn1 を インストール
--> 依存性の処理をしています: perl-Git = 1.8.3.1-1.28.amzn1 のパッケージ: git-1.8.3.1-1.28.amzn1.x86_64
--> 依存性の処理をしています: perl(Term::ReadKey) のパッケージ: git-1.8.3.1-1.28.amzn1.x86_64
--> 依存性の処理をしています: perl(Git) のパッケージ: git-1.8.3.1-1.28.amzn1.x86_64
--> 依存性の処理をしています: perl(Error) のパッケージ: git-1.8.3.1-1.28.amzn1.x86_64
--> トランザクションの確認を実行しています。
---> パッケージ perl-Error.noarch 1:0.17015-4.6.amzn1 を インストール
---> パッケージ perl-Git.noarch 0:1.8.3.1-1.28.amzn1 を インストール
---> パッケージ perl-TermReadKey.x86_64 0:2.30-13.5.amzn1 を インストール
--> 依存性解決を終了しました。

依存性を解決しました

==============================================================================================================================================================================
 Package                                      アーキテクチャー                   バージョン                                       リポジトリー                           容量
==============================================================================================================================================================================
インストール中:
 git                                          x86_64                             1.8.3.1-1.28.amzn1                               amzn-main                             7.8 M
依存性関連でのインストールをします:
 perl-Error                                   noarch                             1:0.17015-4.6.amzn1                              amzn-main                              27 k
 perl-Git                                     noarch                             1.8.3.1-1.28.amzn1                               amzn-main                              54 k
 perl-TermReadKey                             x86_64                             2.30-13.5.amzn1                                  amzn-main                              32 k

トランザクションの要約
==============================================================================================================================================================================
インストール  1 パッケージ (+3 個の依存関係のパッケージ)

総ダウンロード容量: 7.9 M
インストール容量: 19 M
Is this ok [y/d/N]: y
Downloading packages:
(1/4): git-1.8.3.1-1.28.amzn1.x86_64.rpm                                                                                                               | 7.8 MB     00:00     
(2/4): perl-Error-0.17015-4.6.amzn1.noarch.rpm                                                                                                         |  27 kB     00:00     
(3/4): perl-Git-1.8.3.1-1.28.amzn1.noarch.rpm                                                                                                          |  54 kB     00:00     
(4/4): perl-TermReadKey-2.30-13.5.amzn1.x86_64.rpm                                                                                                     |  32 kB     00:00     
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
合計                                                                                                                                           16 MB/s | 7.9 MB     00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  インストール中          : 1:perl-Error-0.17015-4.6.amzn1.noarch                                                                                                         1/4 
  インストール中          : perl-TermReadKey-2.30-13.5.amzn1.x86_64                                                                                                       2/4 
  インストール中          : perl-Git-1.8.3.1-1.28.amzn1.noarch                                                                                                            3/4 
  インストール中          : git-1.8.3.1-1.28.amzn1.x86_64                                                                                                                 4/4 
  検証中                  : git-1.8.3.1-1.28.amzn1.x86_64                                                                                                                 1/4 
  検証中                  : 1:perl-Error-0.17015-4.6.amzn1.noarch                                                                                                         2/4 
  検証中                  : perl-TermReadKey-2.30-13.5.amzn1.x86_64                                                                                                       3/4 
  検証中                  : perl-Git-1.8.3.1-1.28.amzn1.noarch                                                                                                            4/4 

インストール:
  git.x86_64 0:1.8.3.1-1.28.amzn1                                                                                                                                             

依存性関連をインストールしました:
  perl-Error.noarch 1:0.17015-4.6.amzn1                   perl-Git.noarch 0:1.8.3.1-1.28.amzn1                   perl-TermReadKey.x86_64 0:2.30-13.5.amzn1                  

完了しました!

gitがインストールされていることの確認

[ec2-user@ip-XXX-XX-XX-XXX ~]$ git
usage: git [--version] [--help] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]

The most commonly used git commands are:
   add        Add file contents to the index
   bisect     Find by binary search the change that introduced a bug
   branch     List, create, or delete branches
   checkout   Checkout a branch or paths to the working tree
   clone      Clone a repository into a new directory
   commit     Record changes to the repository
   diff       Show changes between commits, commit and working tree, etc
   fetch      Download objects and refs from another repository
   grep       Print lines matching a pattern
   init       Create an empty Git repository or reinitialize an existing one
   log        Show commit logs
   merge      Join two or more development histories together
   mv         Move or rename a file, a directory, or a symlink
   pull       Fetch from and merge with another repository or a local branch
   push       Update remote refs along with associated objects
   rebase     Forward-port local commits to the updated upstream head
   reset      Reset current HEAD to the specified state
   rm         Remove files from the working tree and from the index
   show       Show various types of objects
   status     Show the working tree status
   tag        Create, list, delete or verify a tag object signed with GPG

'git help -a' and 'git help -g' lists available subcommands and some
concept guides. See 'git help <command>' or 'git help <concept>'

neobundleのインストール

[ec2-user@ip-XXX-XX-XX-XXX ~]$ mkdir -p ~/.vim/bundle
[ec2-user@ip-XXX-XX-XX-XXX ~]$ git clone https://github.com/Shougo/neobundle.vim ~/.vim/bundle/neobundle.vim
Cloning into '/home/ec2-user/.vim/bundle/neobundle.vim'...
remote: Reusing existing pack: 6267, done.
remote: Total 6267 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (6267/6267), 1.47 MiB | 587.00 KiB/s, done.
Resolving deltas: 100% (2572/2572), done.
[ec2-user@ip-XXX-XX-XX-XXX ~]$ ls -la
合計 127636
drwx------ 11 ec2-user ec2-user      4096  3月 22 07:51 2014 .
drwxr-xr-x  3 root     root          4096 12月 10 23:47 2013 ..
-rw-------  1 ec2-user ec2-user      4110  3月 19 13:13 2014 .bash_history
-rw-r--r--  1 ec2-user ec2-user        18  9月  4 18:23 2013 .bash_logout
-rw-r--r--  1 ec2-user ec2-user       176  9月  4 18:23 2013 .bash_profile
-rw-r--r--  1 ec2-user ec2-user       124  9月  4 18:23 2013 .bashrc
drwxr-xr-x  5 ec2-user ec2-user      4096  3月 19 12:59 2014 .cabal
drwxrwxr-x  3 ec2-user ec2-user      4096  3月 19 12:17 2014 .ghc
drwxrw----  3 ec2-user ec2-user      4096  3月 22 07:51 2014 .pki
drwx------  2 ec2-user ec2-user      4096  3月 19 10:41 2014 .ssh
drwxr-xr-x  3 ec2-user ec2-user      4096  3月 22 07:51 2014 .vim
-rw-------  1 ec2-user ec2-user      4723  3月 22 07:49 2014 .viminfo
drwxr-xr-x  7 ec2-user ec2-user      4096  3月 19 12:41 2014 Cabal-1.18.1.3
-rw-r--r--  1 root     root        705715  3月  4 21:03 2014 Cabal-1.18.1.3.tar.gz
drwxr-xr-x 16 ec2-user ec2-user      4096  3月 19 12:59 2014 cabal-install-1.18.0.3
-rw-r--r--  1 root     root        254044  3月  4 21:22 2014 cabal-install-1.18.0.3.tar.gz
drwxrwxr-x 14 ec2-user ec2-user      4096  3月 19 11:13 2014 ghc-7.6.3
-rw-r--r--  1 root     root     127161641  4月 19 23:00 2013 ghc-7.6.3-x86_64-unknown-linux.tar.bz2
drwxr-xr-x  5 ec2-user ec2-user      4096  3月 19 11:22 2014 haskell-platform-2013.2.0.0
-rw-rw-r--  1 ec2-user ec2-user   2490645  5月  4 21:37 2013 haskell-platform-2013.2.0.0.tar.gz

neobundleを使うようにvimrcの設定

[ec2-user@ip-XXX-XX-XX-XXX ~]$ sudo vim .vimrc

vimを起動してneobundleをインストール

[ec2-user@ip-XXX-XX-XX-XXX ~]$ vim
Not installed bundles:  ['vim2hs']
Install bundles now?
(y)es, [N]o: y

[neobundle/install] Update started: (2014/03/22 08:09:38)
[neobundle/install] (1/1): |vim2hs| git clone --recursive https://github.com/dag/vim2hs.git "/home/ec2-user/.vim/bundle/vim2hs"
[neobundle/install] (1/1): |vim2hs| Updated
[neobundle/install] |vim2hs|  -> ab6197b5c50c434c5144775e290b54056dff47e8
[neobundle/install] Installed/Updated bundles:
vim2hs
続けるにはENTERを押すかコマンドを入力してください

ghc-modのインストール

[ec2-user@ip-XXX-XX-XX-XXX ~]$ .cabal/bin/cabal install ghc-mod
Config file path source is default config file.
Config file /home/ec2-user/.cabal/config not found.
Writing default configuration to /home/ec2-user/.cabal/config
Warning: The package list for 'hackage.haskell.org' does not exist. Run 'cabal
update' to download it.
cabal: There is no package named 'ghc-mod'.
You may need to run 'cabal update' to get the latest list of available
packages.

cabalが古いみたいなので、指示に従ってアップデート

[ec2-user@ip-XXX-XX-XX-XXX ~]$ .cabal/bin/cabal update
Downloading the latest package list from hackage.haskell.org

再度ghc-modのインストール(途中で失敗、ログが長いので省略)

[ec2-user@ip-XXX-XX-XX-XXX ~]$ .cabal/bin/cabal install ghc-mod
Resolving dependencies...
Downloading base-unicode-symbols-0.2.2.4...
Configuring base-unicode-symbols-0.2.2.4...
Building base-unicode-symbols-0.2.2.4...
[途中省略]
Preprocessing library base-unicode-symbols-0.2.2.4...
/home/ec2-user/.cabal/lib/x86_64-linux-ghc-7.6.3/io-choice-0.0.5
Registering io-choice-0.0.5...
Installed io-choice-0.0.5
cabal: Error: some packages failed to install:
ghc-mod-3.1.7 depends on haskell-src-exts-1.14.0.1 which failed to install.
haskell-src-exts-1.14.0.1 failed during the configure step. The exception was:
ExitFailure 1
hlint-1.8.59 depends on haskell-src-exts-1.14.0.1 which failed to install.

もう一度やってみる

[ec2-user@ip-XXX-XX-XX-XXX ~]$ .cabal/bin/cabal install ghc-mod
Resolving dependencies...
[1 of 1] Compiling Main             ( /tmp/haskell-src-exts-1.14.0.1-3046/haskell-src-exts-1.14.0.1/Setup.hs, /tmp/haskell-src-exts-1.14.0.1-3046/haskell-src-exts-1.14.0.1/dist/setup/Main.o )
Linking /tmp/haskell-src-exts-1.14.0.1-3046/haskell-src-exts-1.14.0.1/dist/setup/setup ...
Configuring haskell-src-exts-1.14.0.1...
setup: The program happy version >=1.17 is required but it could not be found.
Failed to install haskell-src-exts-1.14.0.1
cabal: Error: some packages failed to install:
ghc-mod-3.1.7 depends on haskell-src-exts-1.14.0.1 which failed to install.
haskell-src-exts-1.14.0.1 failed during the configure step. The exception was:
ExitFailure 1
hlint-1.8.59 depends on haskell-src-exts-1.14.0.1 which failed to install.
[ec2-user@ip-XXX-XX-XX-XXX ~]$ 

haskell-src-eextsのインストール中に失敗しているので、これ単体でインストールする。
[ec2-user@ip-XXX-XX-XX-XXX ~]$ cabal install haskell-src-exts
Resolving dependencies...
[1 of 1] Compiling Main             ( /tmp/haskell-src-exts-1.14.0.1-3422/haskell-src-exts-1.14.0.1/Setup.hs, /tmp/haskell-src-exts-1.14.0.1-3422/haskell-src-exts-1.14.0.1/dist/setup/Main.o )
Linking /tmp/haskell-src-exts-1.14.0.1-3422/haskell-src-exts-1.14.0.1/dist/setup/setup ...
Configuring haskell-src-exts-1.14.0.1...
setup: The program happy version >=1.17 is required but it could not be found.
Failed to install haskell-src-exts-1.14.0.1
cabal: Error: some packages failed to install:
haskell-src-exts-1.14.0.1 failed during the configure step. The exception was:
ExitFailure 1

haskell-src-eextsのインストールに失敗していが、ログをみるとhappyなるものがないとのことなので、happyをインストールする。

[ec2-user@ip-XXX-XX-XX-XXX ~]$ cabal install happy
Resolving dependencies...
Downloading happy-1.19.3...
[1 of 1] Compiling Main             ( /tmp/happy-1.19.3-3484/happy-1.19.3/Setup.lhs, /tmp/happy-1.19.3-3484/happy-1.19.3/dist/setup/Main.o )
Linking /tmp/happy-1.19.3-3484/happy-1.19.3/dist/setup/setup ...
Configuring happy-1.19.3...
Building happy-1.19.3...
Preprocessing executable 'happy' for happy-1.19.3...
[ 1 of 18] Compiling NameSet          ( src/NameSet.hs, dist/build/happy/happy-tmp/NameSet.o )
[ 2 of 18] Compiling Target           ( src/Target.lhs, dist/build/happy/happy-tmp/Target.o )
[ 3 of 18] Compiling AbsSyn           ( src/AbsSyn.lhs, dist/build/happy/happy-tmp/AbsSyn.o )
[ 4 of 18] Compiling ParamRules       ( src/ParamRules.hs, dist/build/happy/happy-tmp/ParamRules.o )
[ 5 of 18] Compiling GenUtils         ( src/GenUtils.lhs, dist/build/happy/happy-tmp/GenUtils.o )
[ 6 of 18] Compiling ParseMonad       ( src/ParseMonad.lhs, dist/build/happy/happy-tmp/ParseMonad.o )
[ 7 of 18] Compiling Lexer            ( src/Lexer.lhs, dist/build/happy/happy-tmp/Lexer.o )
[ 8 of 18] Compiling Parser           ( dist/build/happy/happy-tmp/Parser.hs, dist/build/happy/happy-tmp/Parser.o )
[ 9 of 18] Compiling AttrGrammar      ( src/AttrGrammar.lhs, dist/build/happy/happy-tmp/AttrGrammar.o )
[10 of 18] Compiling AttrGrammarParser ( dist/build/happy/happy-tmp/AttrGrammarParser.hs, dist/build/happy/happy-tmp/AttrGrammarParser.o )
[11 of 18] Compiling Grammar          ( src/Grammar.lhs, dist/build/happy/happy-tmp/Grammar.o )
[12 of 18] Compiling First            ( src/First.lhs, dist/build/happy/happy-tmp/First.o )
[13 of 18] Compiling LALR             ( src/LALR.lhs, dist/build/happy/happy-tmp/LALR.o )
[14 of 18] Compiling Paths_happy      ( dist/build/autogen/Paths_happy.hs, dist/build/happy/happy-tmp/Paths_happy.o )
[15 of 18] Compiling ProduceCode      ( src/ProduceCode.lhs, dist/build/happy/happy-tmp/ProduceCode.o )
[16 of 18] Compiling ProduceGLRCode   ( src/ProduceGLRCode.lhs, dist/build/happy/happy-tmp/ProduceGLRCode.o )
[17 of 18] Compiling Info             ( src/Info.lhs, dist/build/happy/happy-tmp/Info.o )
[18 of 18] Compiling Main             ( src/Main.lhs, dist/build/happy/happy-tmp/Main.o )
Linking dist/build/happy/happy ...
Installing executable(s) in /home/ec2-user/.cabal/bin
Installed happy-1.19.3

再度ghc-modをインストール。cabalはインストール失敗したところから再開してくれるようなので、haskell-src-extsのインストールから実施してくれる。

[ec2-user@ip-XXX-XX-XX-XXX ~]$ cabal install ghc-mod
Resolving dependencies...
[1 of 1] Compiling Main             ( /tmp/haskell-src-exts-1.14.0.1-3777/haskell-src-exts-1.14.0.1/Setup.hs, /tmp/haskell-src-exts-1.14.0.1-3777/haskell-src-exts-1.14.0.1/dist/setup/Main.o )
Linking /tmp/haskell-src-exts-1.14.0.1-3777/haskell-src-exts-1.14.0.1/dist/setup/setup ...
Configuring haskell-src-exts-1.14.0.1...
Building haskell-src-exts-1.14.0.1...
Preprocessing library haskell-src-exts-1.14.0.1...
[ 1 of 22] Compiling Language.Haskell.Exts.Annotated.Syntax ( src/Language/Haskell/Exts/Annotated/Syntax.hs, dist/build/Language/Haskell/Exts/Annotated/Syntax.o )
Failed to install haskell-src-exts-1.14.0.1
cabal: Error: some packages failed to install:
ghc-mod-3.1.7 depends on haskell-src-exts-1.14.0.1 which failed to install.
haskell-src-exts-1.14.0.1 failed during the building phase. The exception was:
ExitFailure 9
hlint-1.8.59 depends on haskell-src-exts-1.14.0.1 which failed to install.

しかし今回も失敗。ただし、エラーコードがかわっている。
メモリ不足のようなので、スワップを大きくする。

[ec2-user@ip-XXX-XX-XX-XXX ~]$ sudo mkswap /swapfile
mkswap: /swapfile: warning: don't erase bootbits sectors
        on whole disk. Use -f to force.
スワップ空間バージョン1を設定します、サイズ = 1048572 KiB
ラベルはありません, UUID=4cf3a11b-ed85-49ce-badd-7f0911f26df2
[ec2-user@ip-XXX-XX-XX-XXX ~]$ swapon /swapfile
[ec2-user@ip-XXX-XX-XX-XXX ~]$ sudo swapon /swapfile

再度ghc-modをインストール

[ec2-user@ip-XXX-XX-XX-XXX ~]$ cabal install ghc-mod
Resolving dependencies...
[1 of 1] Compiling Main             ( /tmp/haskell-src-exts-1.14.0.1-4654/haskell-src-exts-1.14.0.1/Setup.hs, /tmp/haskell-src-exts-1.14.0.1-4654/haskell-src-exts-1.14.0.1/dist/setup/Main.o )
Linking /tmp/haskell-src-exts-1.14.0.1-4654/haskell-src-exts-1.14.0.1/dist/setup/setup ...
Configuring haskell-src-exts-1.14.0.1...
Building haskell-src-exts-1.14.0.1...
Preprocessing library haskell-src-exts-1.14.0.1...
[ 1 of 22] Compiling Language.Haskell.Exts.Annotated.Syntax ( src/Language/Haskell/Exts/Annotated/Syntax.hs, dist/build/Language/Haskell/Exts/Annotated/Syntax.o )


[ 2 of 22] Compiling Language.Haskell.Exts.ParseSyntax ( src/Language/Haskell/Exts/ParseSyntax.hs, dist/build/Language/Haskell/Exts/ParseSyntax.o )
[ 3 of 22] Compiling Language.Haskell.Exts.Annotated.Build ( src/Language/Haskell/Exts/Annotated/Build.hs, dist/build/Language/Haskell/Exts/Annotated/Build.o )
[ 4 of 22] Compiling Language.Haskell.Exts.SrcLoc ( src/Language/Haskell/Exts/SrcLoc.hs, dist/build/Language/Haskell/Exts/SrcLoc.o )
[ 5 of 22] Compiling Language.Haskell.Exts.Comments ( src/Language/Haskell/Exts/Comments.hs, dist/build/Language/Haskell/Exts/Comments.o )
[ 6 of 22] Compiling Language.Haskell.Exts.Annotated.ExactPrint ( src/Language/Haskell/Exts/Annotated/ExactPrint.hs, dist/build/Language/Haskell/Exts/Annotated/ExactPrint.o )
[ 7 of 22] Compiling Language.Haskell.Exts.Extension ( src/Language/Haskell/Exts/Extension.hs, dist/build/Language/Haskell/Exts/Extension.o )
[ 8 of 22] Compiling Language.Haskell.Exts.ExtScheme ( src/Language/Haskell/Exts/ExtScheme.hs, dist/build/Language/Haskell/Exts/ExtScheme.o )
[ 9 of 22] Compiling Language.Haskell.Exts.Syntax ( src/Language/Haskell/Exts/Syntax.hs, dist/build/Language/Haskell/Exts/Syntax.o )

[10 of 22] Compiling Language.Haskell.Exts.Build ( src/Language/Haskell/Exts/Build.hs, dist/build/Language/Haskell/Exts/Build.o )
[11 of 22] Compiling Language.Haskell.Exts.Fixity ( src/Language/Haskell/Exts/Fixity.hs, dist/build/Language/Haskell/Exts/Fixity.o )
[12 of 22] Compiling Language.Haskell.Exts.ParseMonad ( src/Language/Haskell/Exts/ParseMonad.hs, dist/build/Language/Haskell/Exts/ParseMonad.o )
[13 of 22] Compiling Language.Haskell.Exts.InternalLexer ( src/Language/Haskell/Exts/InternalLexer.hs, dist/build/Language/Haskell/Exts/InternalLexer.o )
[14 of 22] Compiling Language.Haskell.Exts.Lexer ( src/Language/Haskell/Exts/Lexer.hs, dist/build/Language/Haskell/Exts/Lexer.o )
[15 of 22] Compiling Language.Haskell.Exts.Annotated.Simplify ( src/Language/Haskell/Exts/Annotated/Simplify.hs, dist/build/Language/Haskell/Exts/Annotated/Simplify.o )
[16 of 22] Compiling Language.Haskell.Exts.Pretty ( src/Language/Haskell/Exts/Pretty.hs, dist/build/Language/Haskell/Exts/Pretty.o )
[17 of 22] Compiling Language.Haskell.Exts.ParseUtils ( src/Language/Haskell/Exts/ParseUtils.hs, dist/build/Language/Haskell/Exts/ParseUtils.o )
[18 of 22] Compiling Language.Haskell.Exts.Annotated.Fixity ( src/Language/Haskell/Exts/Annotated/Fixity.hs, dist/build/Language/Haskell/Exts/Annotated/Fixity.o )
[19 of 22] Compiling Language.Haskell.Exts.InternalParser ( dist/build/Language/Haskell/Exts/InternalParser.hs, dist/build/Language/Haskell/Exts/InternalParser.o )

[20 of 22] Compiling Language.Haskell.Exts.Parser ( src/Language/Haskell/Exts/Parser.hs, dist/build/Language/Haskell/Exts/Parser.o )
[21 of 22] Compiling Language.Haskell.Exts.Annotated ( src/Language/Haskell/Exts/Annotated.hs, dist/build/Language/Haskell/Exts/Annotated.o )
[22 of 22] Compiling Language.Haskell.Exts ( src/Language/Haskell/Exts.hs, dist/build/Language/Haskell/Exts.o )
In-place registering haskell-src-exts-1.14.0.1...
Installing library in
/home/ec2-user/.cabal/lib/x86_64-linux-ghc-7.6.3/haskell-src-exts-1.14.0.1
Registering haskell-src-exts-1.14.0.1...
Installed haskell-src-exts-1.14.0.1
Downloading hlint-1.8.59...
Configuring hlint-1.8.59...
Building hlint-1.8.59...
Preprocessing library hlint-1.8.59...
[ 1 of 36] Compiling HSE.Type         ( src/HSE/Type.hs, dist/build/HSE/Type.o )
[ 2 of 36] Compiling HSE.FreeVars     ( src/HSE/FreeVars.hs, dist/build/HSE/FreeVars.o )
[ 3 of 36] Compiling HSE.Util         ( src/HSE/Util.hs, dist/build/HSE/Util.o )
[ 4 of 36] Compiling HSE.Match        ( src/HSE/Match.hs, dist/build/HSE/Match.o )
[ 5 of 36] Compiling HSE.Scope        ( src/HSE/Scope.hs, dist/build/HSE/Scope.o )
[ 6 of 36] Compiling Parallel         ( src/Parallel.hs, dist/build/Parallel.o )
[ 7 of 36] Compiling Paths_hlint      ( dist/build/autogen/Paths_hlint.hs, dist/build/Paths_hlint.o )
[ 8 of 36] Compiling Util             ( src/Util.hs, dist/build/Util.o )
[ 9 of 36] Compiling CmdLine          ( src/CmdLine.hs, dist/build/CmdLine.o )
[10 of 36] Compiling HSE.Bracket      ( src/HSE/Bracket.hs, dist/build/HSE/Bracket.o )
[11 of 36] Compiling HSE.Evaluate     ( src/HSE/Evaluate.hs, dist/build/HSE/Evaluate.o )
[12 of 36] Compiling HSE.All          ( src/HSE/All.hs, dist/build/HSE/All.o )
[13 of 36] Compiling Hint.Util        ( src/Hint/Util.hs, dist/build/Hint/Util.o )
[14 of 36] Compiling Settings         ( src/Settings.hs, dist/build/Settings.o )
[15 of 36] Compiling Proof            ( src/Proof.hs, dist/build/Proof.o )
[16 of 36] Compiling Idea             ( src/Idea.hs, dist/build/Idea.o )
[17 of 36] Compiling Hint.Type        ( src/Hint/Type.hs, dist/build/Hint/Type.o )
[18 of 36] Compiling Hint.Match       ( src/Hint/Match.hs, dist/build/Hint/Match.o )
[19 of 36] Compiling Hint.List        ( src/Hint/List.hs, dist/build/Hint/List.o )
[20 of 36] Compiling Hint.ListRec     ( src/Hint/ListRec.hs, dist/build/Hint/ListRec.o )
[21 of 36] Compiling Hint.Monad       ( src/Hint/Monad.hs, dist/build/Hint/Monad.o )
[22 of 36] Compiling Hint.Lambda      ( src/Hint/Lambda.hs, dist/build/Hint/Lambda.o )
[23 of 36] Compiling Hint.Bracket     ( src/Hint/Bracket.hs, dist/build/Hint/Bracket.o )
[24 of 36] Compiling Hint.Naming      ( src/Hint/Naming.hs, dist/build/Hint/Naming.o )
[25 of 36] Compiling Hint.Structure   ( src/Hint/Structure.hs, dist/build/Hint/Structure.o )
[26 of 36] Compiling Hint.Import      ( src/Hint/Import.hs, dist/build/Hint/Import.o )
[27 of 36] Compiling Hint.Pragma      ( src/Hint/Pragma.hs, dist/build/Hint/Pragma.o )
[28 of 36] Compiling Hint.Extensions  ( src/Hint/Extensions.hs, dist/build/Hint/Extensions.o )
[29 of 36] Compiling Hint.Duplicate   ( src/Hint/Duplicate.hs, dist/build/Hint/Duplicate.o )
[30 of 36] Compiling Hint.All         ( src/Hint/All.hs, dist/build/Hint/All.o )
[31 of 36] Compiling Apply            ( src/Apply.hs, dist/build/Apply.o )
[32 of 36] Compiling Report           ( src/Report.hs, dist/build/Report.o )
[33 of 36] Compiling Test             ( src/Test.hs, dist/build/Test.o )
[34 of 36] Compiling Language.Haskell.HLint2 ( src/Language/Haskell/HLint2.hs, dist/build/Language/Haskell/HLint2.o )
[35 of 36] Compiling HLint            ( src/HLint.hs, dist/build/HLint.o )
[36 of 36] Compiling Language.Haskell.HLint ( src/Language/Haskell/HLint.hs, dist/build/Language/Haskell/HLint.o )
In-place registering hlint-1.8.59...
Preprocessing executable 'hlint' for hlint-1.8.59...
[ 1 of 36] Compiling HSE.Type         ( src/HSE/Type.hs, dist/build/hlint/hlint-tmp/HSE/Type.o )
[ 2 of 36] Compiling HSE.Util         ( src/HSE/Util.hs, dist/build/hlint/hlint-tmp/HSE/Util.o )
[ 3 of 36] Compiling HSE.Scope        ( src/HSE/Scope.hs, dist/build/hlint/hlint-tmp/HSE/Scope.o )
[ 4 of 36] Compiling HSE.Match        ( src/HSE/Match.hs, dist/build/hlint/hlint-tmp/HSE/Match.o )
[ 5 of 36] Compiling HSE.FreeVars     ( src/HSE/FreeVars.hs, dist/build/hlint/hlint-tmp/HSE/FreeVars.o )
[ 6 of 36] Compiling Parallel         ( src/Parallel.hs, dist/build/hlint/hlint-tmp/Parallel.o )
[ 7 of 36] Compiling Util             ( src/Util.hs, dist/build/hlint/hlint-tmp/Util.o )
[ 8 of 36] Compiling HSE.Bracket      ( src/HSE/Bracket.hs, dist/build/hlint/hlint-tmp/HSE/Bracket.o )
[ 9 of 36] Compiling HSE.Evaluate     ( src/HSE/Evaluate.hs, dist/build/hlint/hlint-tmp/HSE/Evaluate.o )
[10 of 36] Compiling Paths_hlint      ( dist/build/autogen/Paths_hlint.hs, dist/build/hlint/hlint-tmp/Paths_hlint.o )
[11 of 36] Compiling CmdLine          ( src/CmdLine.hs, dist/build/hlint/hlint-tmp/CmdLine.o )
[12 of 36] Compiling HSE.All          ( src/HSE/All.hs, dist/build/hlint/hlint-tmp/HSE/All.o )
[13 of 36] Compiling Settings         ( src/Settings.hs, dist/build/hlint/hlint-tmp/Settings.o )
[14 of 36] Compiling Idea             ( src/Idea.hs, dist/build/hlint/hlint-tmp/Idea.o )
[15 of 36] Compiling Proof            ( src/Proof.hs, dist/build/hlint/hlint-tmp/Proof.o )
[16 of 36] Compiling Hint.Type        ( src/Hint/Type.hs, dist/build/hlint/hlint-tmp/Hint/Type.o )
[17 of 36] Compiling Hint.Bracket     ( src/Hint/Bracket.hs, dist/build/hlint/hlint-tmp/Hint/Bracket.o )
[18 of 36] Compiling Hint.Duplicate   ( src/Hint/Duplicate.hs, dist/build/hlint/hlint-tmp/Hint/Duplicate.o )
[19 of 36] Compiling Hint.Extensions  ( src/Hint/Extensions.hs, dist/build/hlint/hlint-tmp/Hint/Extensions.o )
[20 of 36] Compiling Hint.Import      ( src/Hint/Import.hs, dist/build/hlint/hlint-tmp/Hint/Import.o )
[21 of 36] Compiling Hint.List        ( src/Hint/List.hs, dist/build/hlint/hlint-tmp/Hint/List.o )
[22 of 36] Compiling Hint.Match       ( src/Hint/Match.hs, dist/build/hlint/hlint-tmp/Hint/Match.o )
[23 of 36] Compiling Hint.Monad       ( src/Hint/Monad.hs, dist/build/hlint/hlint-tmp/Hint/Monad.o )
[24 of 36] Compiling Hint.Naming      ( src/Hint/Naming.hs, dist/build/hlint/hlint-tmp/Hint/Naming.o )
[25 of 36] Compiling Hint.Pragma      ( src/Hint/Pragma.hs, dist/build/hlint/hlint-tmp/Hint/Pragma.o )
[26 of 36] Compiling Hint.Structure   ( src/Hint/Structure.hs, dist/build/hlint/hlint-tmp/Hint/Structure.o )
[27 of 36] Compiling Hint.Util        ( src/Hint/Util.hs, dist/build/hlint/hlint-tmp/Hint/Util.o )
[28 of 36] Compiling Hint.Lambda      ( src/Hint/Lambda.hs, dist/build/hlint/hlint-tmp/Hint/Lambda.o )
[29 of 36] Compiling Hint.ListRec     ( src/Hint/ListRec.hs, dist/build/hlint/hlint-tmp/Hint/ListRec.o )
[30 of 36] Compiling Hint.All         ( src/Hint/All.hs, dist/build/hlint/hlint-tmp/Hint/All.o )
[31 of 36] Compiling Apply            ( src/Apply.hs, dist/build/hlint/hlint-tmp/Apply.o )
[32 of 36] Compiling Test             ( src/Test.hs, dist/build/hlint/hlint-tmp/Test.o )
[33 of 36] Compiling Report           ( src/Report.hs, dist/build/hlint/hlint-tmp/Report.o )
[34 of 36] Compiling HLint            ( src/HLint.hs, dist/build/hlint/hlint-tmp/HLint.o )
[35 of 36] Compiling Language.Haskell.HLint ( src/Language/Haskell/HLint.hs, dist/build/hlint/hlint-tmp/Language/Haskell/HLint.o )
[36 of 36] Compiling Main             ( src/Main.hs, dist/build/hlint/hlint-tmp/Main.o )
Linking dist/build/hlint/hlint ...
Installing library in
/home/ec2-user/.cabal/lib/x86_64-linux-ghc-7.6.3/hlint-1.8.59
Installing executable(s) in /home/ec2-user/.cabal/bin
Registering hlint-1.8.59...
Installed hlint-1.8.59
Downloading ghc-mod-3.1.7...
Configuring ghc-mod-3.1.7...
Building ghc-mod-3.1.7...
Preprocessing library ghc-mod-3.1.7...
[ 1 of 18] Compiling Language.Haskell.GhcMod.GHCChoice ( Language/Haskell/GhcMod/GHCChoice.hs, dist/build/Language/Haskell/GhcMod/GHCChoice.o )
[ 2 of 18] Compiling Language.Haskell.GhcMod.Types ( Language/Haskell/GhcMod/Types.hs, dist/build/Language/Haskell/GhcMod/Types.o )
[ 3 of 18] Compiling Language.Haskell.GhcMod.CabalApi ( Language/Haskell/GhcMod/CabalApi.hs, dist/build/Language/Haskell/GhcMod/CabalApi.o )
[ 4 of 18] Compiling Language.Haskell.GhcMod.Gap ( Language/Haskell/GhcMod/Gap.hs, dist/build/Language/Haskell/GhcMod/Gap.o )
[ 5 of 18] Compiling Language.Haskell.GhcMod.Doc ( Language/Haskell/GhcMod/Doc.hs, dist/build/Language/Haskell/GhcMod/Doc.o )
[ 6 of 18] Compiling Language.Haskell.GhcMod.ErrMsg ( Language/Haskell/GhcMod/ErrMsg.hs, dist/build/Language/Haskell/GhcMod/ErrMsg.o )
[ 7 of 18] Compiling Language.Haskell.GhcMod.Lint ( Language/Haskell/GhcMod/Lint.hs, dist/build/Language/Haskell/GhcMod/Lint.o )
[ 8 of 18] Compiling Language.Haskell.GhcMod.Lang ( Language/Haskell/GhcMod/Lang.hs, dist/build/Language/Haskell/GhcMod/Lang.o )
[ 9 of 18] Compiling Language.Haskell.GhcMod.GHCApi ( Language/Haskell/GhcMod/GHCApi.hs, dist/build/Language/Haskell/GhcMod/GHCApi.o )
[10 of 18] Compiling Language.Haskell.GhcMod.Info ( Language/Haskell/GhcMod/Info.hs, dist/build/Language/Haskell/GhcMod/Info.o )
[11 of 18] Compiling Language.Haskell.GhcMod.List ( Language/Haskell/GhcMod/List.hs, dist/build/Language/Haskell/GhcMod/List.o )
[12 of 18] Compiling Language.Haskell.GhcMod.Internal ( Language/Haskell/GhcMod/Internal.hs, dist/build/Language/Haskell/GhcMod/Internal.o )
[13 of 18] Compiling Language.Haskell.GhcMod.Flag ( Language/Haskell/GhcMod/Flag.hs, dist/build/Language/Haskell/GhcMod/Flag.o )
[14 of 18] Compiling Language.Haskell.GhcMod.Debug ( Language/Haskell/GhcMod/Debug.hs, dist/build/Language/Haskell/GhcMod/Debug.o )
[15 of 18] Compiling Language.Haskell.GhcMod.Cradle ( Language/Haskell/GhcMod/Cradle.hs, dist/build/Language/Haskell/GhcMod/Cradle.o )
[16 of 18] Compiling Language.Haskell.GhcMod.Check ( Language/Haskell/GhcMod/Check.hs, dist/build/Language/Haskell/GhcMod/Check.o )
[17 of 18] Compiling Language.Haskell.GhcMod.Browse ( Language/Haskell/GhcMod/Browse.hs, dist/build/Language/Haskell/GhcMod/Browse.o )
[18 of 18] Compiling Language.Haskell.GhcMod ( Language/Haskell/GhcMod.hs, dist/build/Language/Haskell/GhcMod.o )
In-place registering ghc-mod-3.1.7...
Preprocessing executable 'ghc-mod' for ghc-mod-3.1.7...
[1 of 2] Compiling Paths_ghc_mod    ( dist/build/autogen/Paths_ghc_mod.hs, dist/build/ghc-mod/ghc-mod-tmp/Paths_ghc_mod.o )
[2 of 2] Compiling Main             ( src/GHCMod.hs, dist/build/ghc-mod/ghc-mod-tmp/Main.o )
Linking dist/build/ghc-mod/ghc-mod ...
Installing library in
/home/ec2-user/.cabal/lib/x86_64-linux-ghc-7.6.3/ghc-mod-3.1.7
Installing executable(s) in /home/ec2-user/.cabal/bin
Registering ghc-mod-3.1.7...
Installed ghc-mod-3.1.7


vimrcにghcmod-vimを記述してインストールする。

[ec2-user@ip-XXX-XX-XX-XXX ~]$ vim hoge.hs 
Not installed bundles:  ['ghcmod-vim']
Install bundles now?
(y)es, [N]o: y

[neobundle/install] Update started: (2014/03/22 09:18:27)
[neobundle/install] (1/1): |ghcmod-vim| git clone --recursive https://github.com/eagletmt/ghcmod-vim.git "/home/ec2-user/.vim/bundle/ghcmod-vim"
[neobundle/install] (1/1): |ghcmod-vim| Updated
[neobundle/install] |ghcmod-vim|  -> 6a88e49d5766edf32592c9c4b24921ba42f619c8
[neobundle/install] Installed/Updated bundles:
ghcmod-vim
続けるにはENTERを押すかコマンドを入力してください

ただし、GhcModeTypeしても型が表示されず、コマンドがないとのエラーになる。
vimprocを使うことのようなのでvimrcに記述追加でインストール

[ec2-user@ip-XXX-XX-XX-XXX ~]$ vim hoge.hs 
Not installed bundles:  ['vimproc']
Install bundles now?
(y)es, [N]o: y

[neobundle/install] Update started: (2014/03/22 09:31:30)
[neobundle/install] (1/1): |vimproc| git clone --recursive https://github.com/Shougo/vimproc.git "/home/ec2-user/.vim/bundle/vimproc"
[neobundle/install] (1/1): |vimproc| Updated
[neobundle/install] |vimproc|  -> 92b34f1ed9d2f2900f6a2db964526d6f94fa3d86
[neobundle/install] Installed/Updated bundles:
vimproc
続けるにはENTERを押すかコマンドを入力してください

これでも使えなかった。makeをする必要があるので実施。

[ec2-user@ip-XXX-XX-XX-XXX ~]$ cd .vim/bundle/vimproc/
[ec2-user@ip-XXX-XX-XX-XXX vimproc]$ ls
Makefile    autoload  make_android.mak  make_mac.mak      make_mingw64.mak  make_msvc32.mak  make_sunos.mak  plugin  vest
README.mkd  doc       make_cygwin.mak   make_mingw32.mak  make_msvc.mak     make_msvc64.mak  make_unix.mak   tools
[ec2-user@ip-XXX-XX-XX-XXX vimproc]$ make -f make_unix.mak
cc -W -O2 -Wall -Wno-unused -Wno-unused-parameter -std=gnu99 -pedantic -shared -fPIC -o autoload/vimproc_unix.so autoload/proc.c -lutil

これでやっと使えるようになりました。