Nov 2, 2010

Important things when installing Haskell ghc and packages

Haskell is not like other programming languages. Even when it is installing the compilers installing person must manually install each and every module if he/she needs. I will tell some points that you may need when you are going to use Haskell.
These thing may change in future, but for now it may be the best way.

First thing, do not use "yum install ghc" . This will install " ghc 6-10. " or some old thing. You will be able to download the latest ghc from the website.
link : http://www.haskell.org/ghc/index.html 

If you had install an old version of ghc from yum, you can erase it and install new ghc manually.
$yum erase ghc

Installing ghc from the tar file ease easy. Only you need to do extract the tar file and reat the INSTALL file. You can use the default configurations which will install ghc in /usr/local. To do that you can; (You may need root permission)

$ ./configure
$ make install



Next thing is when you need to install any module, first search it from the http://hackage.haskell.org/  website. This will give all relevant details of the package.

Old version of ghc use a package installation program called Cabal-installer. But the new version is not working with that program. May be in future they will make it, but for now you can't use cabal.

Do not download the package as soon as you see the package downloading link. Go through the web page. You may many important details like;

*  Versions -
            Gives the version information. Very important when you are finding a dependent file. You must use the relevant version of the dependent package.

*  Dependencies -
           Gives information about packages which need to run the current selected package. You can not install, if a single package is missing. This thing also very important. There are words like "or" , "(>2.0)" which you must think before downloading or selecting a dependent file.

*  Built on / Built failure - This will tell if the package will install correctly or not, considering on the ghc version. Some files can only work properly on some ghc versions. Some packages give errors on some ghcs.

Selection the working file may be too hard, but this will help you a lot. Think when you installing a package and you got a error message as you need to install a dependent package, read it correctly and try to install only that dependent package, even if you got a new package if the old one is stable.

No comments:

Post a Comment

Your comments are always welcome ...