唐突にHaskellの話。

Windows環境で動かしたい。下記URLからghc-6.8.2-i386-windows.exeをダウンロードして実行。

http://haskell.org/ghc/download_ghc_682.html#windows

[> next]などクリックしておく。Finishとかでた。

httpd.conf のAddHandler cgi-scriptに.hsを足してApacheを再起動。
index.hsを作成してみる。しようとしたら、どうHello Worldを書いていいかわからない。

Fedora6にGHCをインストール - Problems

によるとputStrLn "Hello World"でよさそうだ。

#!C:\\ghc\\ghc-6.8.2\\?????

putStrLn "Content-type:text/html\\n\\n"
putStrLn "HelloWorld"

??????にいろいろ書いて試してみてるけど
エラー出たり、真っ白だったり。
後でログ見る。

一方Ubuntuの方でも試してみた。また
Fedora6にGHCをインストール - Problems
を参考に、

$ wget http://www.haskell.org/ghc/dist/6.8.2/ghc-6.8.2-i386-unknown-linux.tar.bz2
$ tar xvfj ghc-6.8.2-i386-unknown-linux.tar.bz2
$ cd ghc-6.8.2
$ ./configure
$ sudo make install

して、特に問題なく入れられたっぽい。

$ ghci
とやると
/usr/local/lib/ghc-6.8.2/ghc-6.8.2: error while loading shared libraries: libreadline.so.4: cannot open shared object file: No such file or directory

とか言われるのでlibreadline.so.4とかでググって調査中。