Re: foldr f (head xs) xs is not the same as foldr1 f xs

2005-05-08 Thread Tomasz Zielonka
On Sun, May 08, 2005 at 08:14:30PM +0200, David Sabel wrote: Hi! Subject: foldr f (head xs) xs is not the same as foldr1 f xs I think you forgot about tail: foldr f (head xs) (tail xs) Best regards Tomasz ___ Glasgow-haskell-users mailing list

Re: foldr f (head xs) xs is not the same as foldr1 f xs

2005-05-08 Thread Remi Turk
On Sun, May 08, 2005 at 08:14:30PM +0200, David Sabel wrote: Hi! A small example for the claim mentioned in the subject: Prelude let x = 1:undefined in foldr (curry fst) (head x) x 1 Prelude let x = 1:undefined in foldr1 (curry fst) x *** Exception: Prelude.undefined Perhaps it would

Re: foldr f (head xs) xs is not the same as foldr1 f xs

2005-05-08 Thread David Sabel
Ah! thanks you're right, sorry. My problem arose from the fact that let x = 'A':undefined in head $ (unwords.words) x does not terminate, but now it's clear: For interspersing the blanks you need to evaluate the tail. Sorry again. Cheers, David Tomasz Zielonka schrieb: On Sun, May 08, 2005 at

Re: problem with xlib binding

2005-05-08 Thread Frederik Eaton
FYI, I'm not actually running into any other problems in my application (although as mentioned I'm only using basic functionality). Thanks to Alastair Reid and whoever else contributed to the bindings. Extra features such as waitForEvent are especially appreciated. Should I submit a patch to fix