parsecが見つからなかったののメモ

勉強のためCSVパーサーを写経してたらこんなエラーが出てきた。

csv_parser.hs:33:8:
    Could not find module `Text.ParserCombinators.Parsec'
    Perhaps you meant
      Text.ParserCombinators.ReadPrec (from base)
      Text.ParserCombinators.ReadP (from base)
    Use -v to see a list of the files searched for.

どうもParsecモジュールがないらしい。cabalでインストールしてなかったのか...。

pacmanの中をサーチしてみる。

pacman -Ss haskell | parsec
-> Monadic parser combinators

なんかあったので

pacman -Ss parsec

目を凝らすとhaskell-parsecなるものがあったので

pacman -S haskell-parsec

でインストールした。これでghciでエラーが出ずにcsv-parserプログラムを実行できた。

parseTest file "foo,bar,baz\r\n"

実行例でこれをすると他のライブラリを順次ロードしていってparseTestをすることができた。便利なインタプリタだなと思う。