Re: [Haskell-cafe] Cute code [was: The C Equiv of != in Haskell miscommunication thread]

2007-05-29 Thread Vincent Kraeutler
Donald Bruce Stewart wrote: P.S. Have some cute code: Control.Monad.Fix.fix ((1:) . scanl (+) 1) this is cute indeed! (do you keep an emergency reserve of those around for situations like this? ;-)) ever the interested amateur, i admittedly remain stumped by fix (there's evidence i'm

Re: [Haskell-cafe] Cute code [was: The C Equiv of != in Haskell miscommunication thread]

2007-05-29 Thread Tomasz Zielonka
On Tue, May 29, 2007 at 12:15:23PM +0200, Vincent Kraeutler wrote: Donald Bruce Stewart wrote: P.S. Have some cute code: Control.Monad.Fix.fix ((1:) . scanl (+) 1) this is cute indeed! (do you keep an emergency reserve of those around for situations like this? ;-)) ever the

Re: [Haskell-cafe] Cute code [was: The C Equiv of != in Haskell miscommunication thread]

2007-05-29 Thread Tomasz Zielonka
On Tue, May 29, 2007 at 02:19:31PM +0200, Tomasz Zielonka wrote: On Tue, May 29, 2007 at 12:15:23PM +0200, Vincent Kraeutler wrote: ever the interested amateur, i admittedly remain stumped by fix (there's evidence i'm not the only one [1]) The above code is equivalent to let l = 1 :

Re: [Haskell-cafe] Cute code [was: The C Equiv of != in Haskell miscommunication thread]

2007-05-29 Thread Vincent Kraeutler
Tomasz Zielonka wrote: On Tue, May 29, 2007 at 02:19:31PM +0200, Tomasz Zielonka wrote: On Tue, May 29, 2007 at 12:15:23PM +0200, Vincent Kraeutler wrote: ever the interested amateur, i admittedly remain stumped by fix (there's evidence i'm not the only one [1]) The above

Re: [Haskell-cafe] Cute code [was: The C Equiv of != in Haskell miscommunication thread]

2007-05-29 Thread Vincent Kraeutler
Vincent Kraeutler wrote: Tomasz Zielonka wrote: [snip] anyhow. if someone has a pedestrian's guide to the fixed point operator lying around, a link would be much appreciated. i see that dons has very recently provided an answer for this on reddit:

Re: [Haskell-cafe] Cute code [was: The C Equiv of != in Haskell miscommunication thread]

2007-05-29 Thread Donald Bruce Stewart
vincent: i see that the definition of fix (from Control.Monad.Fix) could not be any simpler: fix f = let x = f x in x same goes for the type: Prelude :t Control.Monad.Fix.fix Control.Monad.Fix.fix :: (a - a) - a it's just that i find it difficult to get concrete intellectual

Re: [Haskell-cafe] Cute code [was: The C Equiv of != in Haskell miscommunication thread]

2007-05-29 Thread David House
On 29/05/07, Vincent Kraeutler [EMAIL PROTECTED] wrote: anyhow. if someone has a pedestrian's guide to the fixed point operator lying around, a link would be much appreciated. Here's a paraphrased quotation from Pierce's Types and Programming Languages: Suppose we want to write a recursive

Re: [Haskell-cafe] Cute code [was: The C Equiv of != in Haskell miscommunication thread]

2007-05-29 Thread Roberto Zunino
(re-joining the list -- I forgot to reply all) Vincent Kraeutler wrote: Roberto Zunino wrote: Vincent Kraeutler wrote: i see that the definition of fix (from Control.Monad.Fix) could not be any simpler: fix f = let x = f x in x I actually consider fix f = f (fix f) to be simpler. Alas,

Re: [Haskell-cafe] Cute code [was: The C Equiv of != in Haskell miscommunication thread]

2007-05-29 Thread Andrew Coppin
Vincent Kraeutler wrote: Donald Bruce Stewart wrote: P.S. Have some cute code: Control.Monad.Fix.fix ((1:) . scanl (+) 1) this is cute indeed! (do you keep an emergency reserve of those around for situations like this? ;-)) LOL! I bet he does as well... I don't know. I

Re: [Haskell-cafe] Cute code [was: The C Equiv of != in Haskell miscommunication thread]

2007-05-29 Thread Albert Y. C. Lai
Vincent Kraeutler wrote: Donald Bruce Stewart wrote: P.S. Have some cute code: Control.Monad.Fix.fix ((1:) . scanl (+) 1) either way, if one of the Masters Of The Shadow Y Style on this list feels like throwing in another koan or two, you'll have at least one thankful audience member