[Haskell-cafe] Application Level server state in Haskell Web server

2007-02-17 Thread Pieter Laeremans
Hello, I'm trying to write a simple module for the haskell web server (hws- cgi). And I would like to write a simple module that maintains some kind of state for a session. But I'm I write I cannot do this in pure Haskell ? Without adopting the sources of the Haskell web server ? I'll

Re: [Haskell-cafe] Application Level server state in Haskell Web server

2007-02-17 Thread Donald Bruce Stewart
pieter: Hello, I'm trying to write a simple module for the haskell web server (hws- cgi). And I would like to write a simple module that maintains some kind of state for a session. But I'm I write I cannot do this in pure Haskell ? Without adopting the sources of the Haskell web

[Haskell-cafe] Recursion in Haskell

2007-02-17 Thread P. R. Stanley
Hi I understand the basic principle of recursion but have difficulty with the following: -- a recursive function -- for calculating the length of lists myLen [] = 0 myLen (x:xs) = 1 + myLen xs What's happening here? Top marks for a comprehensive jargon-free explanation. Thanks in advance Paul

Re: [Haskell-cafe] Recursion in Haskell

2007-02-17 Thread Brandon S. Allbery KF8NH
On Feb 17, 2007, at 21:32 , P. R. Stanley wrote: Hi I understand the basic principle of recursion but have difficulty with the following: -- a recursive function -- for calculating the length of lists myLen [] = 0 myLen (x:xs) = 1 + myLen xs What's happening here? This definition uses

Re: [Haskell-cafe] Recursion in Haskell

2007-02-17 Thread Donald Bruce Stewart
prstanley: Hi I understand the basic principle of recursion but have difficulty with the following: -- a recursive function -- for calculating the length of lists myLen [] = 0 myLen (x:xs) = 1 + myLen xs So this is a definition for the 'length' function on lists. The list data structure

[Haskell-cafe] our worst unsafePerformIO nightmares are upon us!

2007-02-17 Thread Nicolas Frisby
http://www.thinkgeek.com/geektoys/cubegoodies/86b8/ Now you can really show your coders why unsafePerformIO is to be avoided! -Nick ps - Please don't consider this post a product advertisement or endorsement of any kind. ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Recursion in Haskell

2007-02-17 Thread Chris Eidhof
The definition of myLen says: myLen [] = 0 The length for an empty list is zero myLen (x:xs) = 1 + myLen xs The length of a list containing x and some other stuff (xs) is 1 + (the length of the other stuff). So basically, if you've got a list [1,2,3], it will try to do this: myLen