Thursday, 11 December 2008

About Haskell type inference

When somebody tries to tell you that Haskell would be able to infer types, and that type declarations would be unnecessary, ask them to compile the following Haskell code with and without the marked line:

data LC a
= Var a
| App (LC a) (LC a)
| Abs (LC (Maybe a))
deriving (Show, Eq)

my_maybe :: (a -> b) -> Maybe a -> Maybe b
my_maybe f (Just x) = Just (f x)
my_maybe f (Nothing) = Nothing

lcFunc :: (a -> b) -> LC a -> LC b -- try with and without this line --
lcFunc f (Var x) = Var (f x)
lcFunc f (App left right) = App (lcFunc f left) (lcFunc f right)
lcFunc f (Abs t') = Abs (lcFunc (my_maybe f) t')

Remark: i used the ghc 6.8.2 which comes with ubuntu 8.04
Remark2: u might want to use the built-in fmap instead of my_maybe.

Sunday, 7 December 2008

Greece Riots

When police men play 'war'...
BBC News

Friday, 5 December 2008

a FREE COMPUTER - are you serious?

In certain blogs and forums - like gnewsense's - you can read about 'free computers' lately. This sounds nice - and it indeed is -, but it is perhaps not what you think it is. The terminology is somewhat confusing and might need some explanation.
First of all, it is not the computer which is free. The mentioned machine is a Lemote Yeeloong, produced in China and equipped with a MIPS processor. It will not be given away for free: a dutch webshop,, will sell the machine for 330 euros plus taxes plus freight costs. This is surely not what you'd call "free".
Instead what is free about the machine is the software installed. You might say: 'I always get a free Windows operating system when I buy a computer.' Here there are two mistakes, one obvious - the price of the Windows OS is well-hidden in the price for the machine - and one less obvious. The latter is about the meaning of "free".
Free software is often gratuit, but that is not what it's all about. The slogan is "Free as in freedom, not as in free beer". Free software gives you four essential freedoms:
(freedom 0) to run the program
(freedom 1) to make changes to the program (this IMPLIES and is not equivalent to having access to the source code)
(freedom 2) to redistribute copies of the program
(freedom 3) to improve the program and distribute YOUR version of the program (same remark as for freedom 1)
(see also here)
These freedoms were defined and are promoted by Richard M. Stallman, the founder of GNU and the Free Software Foundation.
Now that we know more about which kind of "free" we are talking about, we can ask to which level free software is possible. Unfortunately for many people this is still a dream at the moment, since for some hardware - mainly network devices - non-free software is needed for it to work properly. And even if a machine works with a free operating system such as gNewSense (see above), its BIOS most likely is not free.
Lemote now will put an end to this misery by selling a machine which works with free software AND a free BIOS. Unfortunately one of the most popular free operating systems, gNewSense, is not yet available for MIPS architecture. The FSF is on the search for a programmer who would take over the port of gNewSense to MIPS. So if you are one, take a look at this page.


The project page is here:

A screenshot of the Yeeloong running gNewSense mipsel with Gnome is here:

The hacking page for the Lemote hardware (both Yeeloong laptop and Fuloong mini box) is here:

Thursday, 4 December 2008

Stop DOC attachments

Today I received an email from the 'Ecole Doctorale' containing information about the courses which will be given for the PhD students. Attached to the email there was a DOC file with the dates for the whole year.
On my Debian GNU/Linux operating system I have 2.4 installed, which is able to read most DOC files without problems. But this is not known among "normal" people, i.e. MS Windows users. So in fact if somebody sends you a DOC file she/he supposes that you are running a MS or an Apple operating system with some MS Office installed. Since I felt offended by this assumption, I replied to the secretary that unfortunately I had no MS Office installed, since it was too expensive, and if she could send the files in ODT or PDF.

I expected no reaction at best, or perhaps something like "I do not care" as an answer, but was positively surprised. She even was sorry for not knowing how to save a DOC file as PDF - which is not a surprise, since no MS Office version except for Office 2007 (with a plugin) seems to be capable of doing so. Which is not a surprise, since MS wants to oblige people to buy their products. So you really have to use an external program to get a PDF file from a Word document.

In the end I was not able to suggest a simple solution to the secretary - installing new software is beyond my power. This is a pity, since she really understood the problem.

richard stallman's article
for more information.

my first blog

Well, in the end I could not resist the temptation: I created a blog. Let's see what happens...