Re[2]: [Haskell-cafe] GHC 6.7 on Windows / containers-0.1 package?

2007-09-22 Thread Bulat Ziganshin
Hello Peter, Saturday, September 22, 2007, 1:41:44 AM, you wrote: Is this still up-to-date with the way GHC/GHCi work internally? Then I'll certainly check it out. you should look at SPJ papers' page. it contains section with ghc-implementation details. just a few papers from there, sorted by

Re: [Haskell-cafe] bindings to the xmms_remote API, GList and something more

2007-09-22 Thread Andrea Rossato
On Fri, Sep 21, 2007 at 09:08:13AM +0200, Andrea Rossato wrote: To make a short story long, I needed some client for the Audacious media player, something I could use to remote control it and, since I'm addicted to Haskell, instead of surfing the web to find a suitable client I surfed the web

Re: [Haskell-cafe] bindings to the xmms_remote API, GList and something more

2007-09-22 Thread Andrea Rossato
On Fri, Sep 21, 2007 at 11:44:38AM +0200, Andrea Rossato wrote: I apologize for the noise. The auto-replay is for documentation (who knows, maybe others searching the list archives may find this info useful). I tried to send a couple of messages to inform that the API I was writing a binding

[Haskell-cafe] what is f=f (not) doing ?

2007-09-22 Thread Pasqualino 'Titto' Assini
Hi, if I define: f = f and then try to evaluate 'f' in GHCi, as one would expect, the interpreter never returns an answer. The funny thing is that, while it is stuck in an infinite loop, GHCi doesn't seem to use any CPU time at all. How is this possible? Thanks titto

Re: [Haskell-cafe] what is f=f (not) doing ?

2007-09-22 Thread Neil Mitchell
Hi f = f and then try to evaluate 'f' in GHCi, as one would expect, the interpreter never returns an answer. The funny thing is that, while it is stuck in an infinite loop, GHCi doesn't seem to use any CPU time at all. It's called a black hole. The runtime can detect that f directly

Re: [Haskell-cafe] what is f=f (not) doing ?

2007-09-22 Thread Pasqualino 'Titto' Assini
On Saturday 22 September 2007 10:58:49 Neil Mitchell wrote: Hi f = f and then try to evaluate 'f' in GHCi, as one would expect, the interpreter never returns an answer. The funny thing is that, while it is stuck in an infinite loop, GHCi doesn't seem to use any CPU time at all.

Re: [Haskell-cafe] Composition Operator

2007-09-22 Thread Peter Verswyvelen
Tony Morris wrote: is the same as: (.) :: (b - c) - ((a - b) - (a - c)) .. accepts a function a to c and returns a function. The function returned takes a function a to b and returns a function a to c IMO, that should be accepts a function b to c and returns a function. The function returned

Re: [Haskell-cafe] what is f=f (not) doing ?

2007-09-22 Thread Hugh Perkins
Gotta love lazy infinite loops :-D Sounds like something out of a Douglas Adams novel. Ok, this post is totally off-topic... On 9/22/07, Pasqualino 'Titto' Assini [EMAIL PROTECTED] wrote: The funny thing is that, while it is stuck in an infinite loop, GHCi doesn't seem to use any CPU time

Re: [Haskell-cafe] what is f=f (not) doing ?

2007-09-22 Thread Peter Verswyvelen
I guess you entered a black hole! :-) The problem is that don't understand black holes myself, I just got introduced with the same thing yesterday :-) I confused me a lot too. The only explanation I could give you intuitively is that GHCi is running in multi threaded execution mode, and that

Re: [Haskell-cafe] what is f=f (not) doing ?

2007-09-22 Thread Peter Verswyvelen
Peter Verswyvelen wrote: http://www.haskell.org/ghc/docs/2.10/users_guide/user_146.html http://www.haskell.org/ghc/docs/2.10/users_guide/user_146.htmlseems to confirm that? Oops, sorry, these seems to be docs for Concurrent Haskell... But maybe the experts can confirm if the principle

Re: [Haskell-cafe] Composition Operator

2007-09-22 Thread Malte Milatz
Peter Verswyvelen: Personally I also find the following a good explanation, since it does not introduce lambdas or other scary things for newbies. f . g = composite where composite x = f (g x) I suppose that the usual definition, which is (f . g) x = f (g x), is clear enough. No

Re: [Haskell-cafe] Composition Operator

2007-09-22 Thread PR Stanley
Ah, I understand now. Let me get this right: The resulting (a - c) is a kind of abstract function formed by the pairing of a - b) and (b - c), hence the lambda \x - g (f x), correct? Thanks, Paul At 05:11 22/09/2007, you wrote: Hello, It's probably easiest to think of composition as a

Re: [Haskell-cafe] what is f=f (not) doing ?

2007-09-22 Thread Stefan O'Rear
On Sat, Sep 22, 2007 at 12:58:12PM +0200, Peter Verswyvelen wrote: Peter Verswyvelen wrote: http://www.haskell.org/ghc/docs/2.10/users_guide/user_146.html http://www.haskell.org/ghc/docs/2.10/users_guide/user_146.htmlseems to confirm that? Oops, sorry, these seems to be docs for

Re: [Haskell-cafe] Composition Operator

2007-09-22 Thread Lennart Augustsson
I'm not sure what you mean by abstract function. It's a function like any other function. But otherwise you're right. :) -- Lennart On 9/22/07, PR Stanley [EMAIL PROTECTED] wrote: Ah, I understand now. Let me get this right: The resulting (a - c) is a kind of abstract function formed by

[Haskell-cafe] Template Haskell newbie questions

2007-09-22 Thread Hugo Pacheco
Hi all, I'm try to write some function in TH that I don't even know if it is possible. Consider the example from the tutorials sel 1 2 = [| \(x,_) - x |] sel 2 2 = [| \(_,x) - x |] If I want to write some function that will dynamically create a selection function according to its arguments

[Haskell-cafe] Troubles understanding memoization in SOE

2007-09-22 Thread Peter Verswyvelen
Hi, in SOE, the following memoization function is implemented: memo1 :: (a-b) - (a-b) memo1 f = unsafePerformIO $ do cache - newIORef [] return $ \x - unsafePerformIO $ do vals - readIORef cache case x `inCache` vals of Nothing - do let y = f x

Re: [Haskell-cafe] Composition Operator

2007-09-22 Thread Tony Morris
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Peter Verswyvelen wrote: Tony Morris wrote: is the same as: (.) :: (b - c) - ((a - b) - (a - c)) .. accepts a function a to c and returns a function. The function returned takes a function a to b and returns a function a to c IMO, that

[Haskell-cafe] are some of these reverse algos better than others? is there a quick and dirty way to reveal this fact?

2007-09-22 Thread Thomas Hartman
I came up with the following functions to do reverse. The first one is obviously bad, because of the expensive list concat. The last one, myreverse, I think is the reference implementation you get in the prelude. The ones between, I'm not so sure. I suspect they're naive as the name indicates, but

Re: [Haskell-cafe] are some of these reverse algos better than others? is there a quick and dirty way to reveal this fact?

2007-09-22 Thread Derek Elkins
On Sat, 2007-09-22 at 21:14 -0700, Thomas Hartman wrote: I came up with the following functions to do reverse. The first one is obviously bad, because of the expensive list concat. The last one, myreverse, I think is the reference implementation you get in the prelude. The ones between, I'm

Re: [Haskell-cafe] are some of these reverse algos better than others? is there a quick and dirty way to reveal this fact?

2007-09-22 Thread Stuart Cook
On 9/23/07, Thomas Hartman [EMAIL PROTECTED] wrote: -- this is the usual implementation right? myreverse xs = foldl f [] xs where f accum el = el : accum This is often written reverse = foldl (flip (:)) [] which I quite like, because you can contrast it with foldr (:) [] which of