February 26, 2007

Woke up this morning, had a blue moon in my eyes

I thought I would spend some time this morning trying to learn Haskell.  I happen to have downloaded a copy of WinHugs, and it seems to be functioning properly.

Alas, every function definition example I try to use blows up on me.

From: Beginning Haskell 

Hugs> myNum :: Int
ERROR - Undefined variable “myNum”
Hugs> square :: Int -> Int
ERROR - Undefined variable “square”
Hugs> square n = n*n
ERROR - Syntax error in input (unexpected `=’)

Hmm, maybe the syntax is different?  Looking at the WinHugs documentation, it says it is Haskell 98 compliant, except in some strange ways.  Well, there’s always “Haskell in 5 steps

Hugs> let fac n = if n == 0 then 1 else n * fac (n-1)
ERROR - Syntax error in expression (unexpected end of input)
Hugs> fac n = if n == 0 then 1 else n * fac (n-1)
ERROR - Syntax error in input (unexpected `=’)

Hmmm.  Looking further at the Haskell in 5 steps, it seems like maybe I have to write the factorial program seperately, and load it into WinHugs?  So I create fac.hs, and put it in:

C:\dev\haskell

C:

My Documents

C:\Program Files\WinHugs\

Can it find it in any of those locations?  No.   Even when I use the “Open” command from within WinHugs, it still can find fac.hs, even though I can clearly see it in my file explorer.
So I think that’s enough for one day.

Veronica Mars

Thanks to the miracle of iTunes, we are now finally caught up with the complete 3rd season of Veronica Mars, after watching Season 1 and Season 2 on DVD,thanks to the miracle of Netflix.

Wednesday, the 28th will be the first VMars we’ve actually seen “live” (although we’ll probably watch it via the miracle of the (now nerfed) ReplayTV)

I will be sad when my last ReplayTV dies.  But not sad enough to try to watch it on a PC.