普通のコンパイルは通るけど、
-prof
をつけたら通らない時に解決できるかもしれません
遭遇したエラー
$ ghc -prof -auto-all boid.hs
して、
boid.hs:2:18:
Could not find module ‘System.Random’
Perhaps you haven't installed the profiling libraries for package ‘random-1.1@rando_9Kgekc9yEaLHLNUuw6paWL’?
Use -v to see a list of the files searched for.
random
パッケージインストールしてるのに、Could not find module ...
とかと言われる
解決策
これでパッケージを再インストールすると行けました
(random
になっているところを「Could not find」のモジュールに変えてください)
cabal install -p random --reinstall --force-reinstalls
ちなみに、-p
っていうのが--enable-library-profiling
略ぽいです(多分)