Discussion Forum 2008

Afp
Participating students are encouraged to post their questions related to programming assignments, exercises, and lectures in this discussion forum, as well as answers and hints for fellow students. This serves two purposes:

  • To stimulate interaction between students during the course. A lively discussion is beneficial for everyone.
  • To minimize the startup time for the assignments (for instance, about the software we use, GHC flags that are required for compilation, etc.).

Needless to say, it is strictly prohibited to include (partial) answers to assignments.


Linux installation and old comments

Below, I am leaving comments from the previous year, because some of them might still apply to the current situation. But keep in mind that things might have changed in the meantime. Also, please feel free to add your own discussion items.

On the Linux machines, I have installed GHC plus a collection of additional libraries and tools. If you want another library, you can try to use cabal install in order to install that library in your home directory. In order to use this version of GHC, you have to put /praktikum/afp/linux/bin into your PATH near the beginning. For example, if you're using bash as shell, you can say

export PATH=/praktikum/afp/linux/bin:$PATH
You can also add this line to the .profile file in your home directory to make this change permanent.

You can also remotely login to the Linux machines from Windows machines via ssh.

-- AndresLoeh - 3 Feb 2009

Cool typeclasses

http://conal.net/blog/posts/simplifying-semantics-with-type-class-morphisms/

GTK+ under DOS

To compile and run haskell applications using GTK+ on the windows machines, modify your PATH variable like so:

set PATH=p:\afp\ghc-6.8.1\Gtk2Hs\bin;p:\afp\ghc-6.8.1\bin;%PATH%

-- ErikHesselink - 05 Mar 2008

Hoogle

The current version of Hoogle in the darcs repository is outdated. I had big problems installing this in my ghc 6.8.2 setup. It feds out that the current version depends on an outdated version of cabal. I mailed the author, and you have two options now:

-- ArdBahlman - 27 Feb 2008

Hoogle 3.1 has just been released on Hackage.

-- AndresLoeh - 29 Feb 2008

Profiling on Windows

Version 6.8.2 of the ghc has a bug that pops up when trying to profile using windows. When omitting the file extension of an executable hp2ps will fail. This is easily fixed by calling the full executable name. More can be found at the Trac. -- MathijsSwint - 27 Feb 2008

Haskell Packaging Overview

Nothing new after the lectures, but this Wiki page contains a clear overview of what needs to be done in order to create a nice environment for you own Haskell program:

Haskell/Packaging

Personally I really liked the part where they install a Darcs hook that forces all QuickCheck? tests to pass before a commit is accepted. Nice!

-- SebastiaanVisser - 20 Feb 2008

Linux GHC 6.8.2 installation

I have installed GHC, haddock, gtk2hs, QuickCheck and some additional libraries on the student Linux machines. All that you should have to do in order to use the installation is to put /import/netshare/coop/praktikum/afp/linux/bin into your PATH near the beginning. This should also work from Windows machines via ssh.

-- AndresLoeh - 12 Feb 2008

QuickCheck 2

Note that you should try to install version 2 of QuickCheck? . The correct version can be obtained via darcs from

http://darcs.haskell.org/QuickCheck

-- AndresLoeh - 06 Feb 2008

gtk2hs on OS X

I'm trying to compile gtk2hs on OS X (Leopard), which proves to be quite hard. When installing gtk2 from MacPorts? , I get a weird build error about "gtkprintbackendcups". Anybody who has had more luck? I've tried a different version of GTK, called Gtk+ Mac OS X. That doesn't work either, so I finally resorted to installing GTK from fink. I now have gtk+2 and gtk+2-dev installed, and gtk2hs configure has now finally stopped complaining! My ./configure is now working fine. In summary, this is what I did:

  • Install readline 5.2 from MacPorts?
  • Install the GHC 6.8.2 binary package from the GHC website. I had to do this a couple of times before it finally started working. There were some issues with the readline-framework (you have to have 5.2) and the gmp-framework (I've got it installed in /Libraries/Frameworks).
  • Install QuickCheck? 2.0 from the quickcheck darcs repository
  • Install gtk+2 and gtk+2-dev from fink
  • Download gtk2hs from their website and compile it with the standard configure-make-make install cycle.

-- ChrisEidhof - 06 Feb 2008

Old exams

Old AFP exams (including answers) can be found at http://www.cs.uu.nl/wiki/bin/view/Afp0607/OldExams