[Haskell-cafe] Re: class default method proposal

2007-12-13 Thread apfelmus
Luke Palmer wrote: Isn't a type which is both a Monad and a Comonad just Identity? (I'm actually not sure, I'm just conjecting) Good idea, but it's not the case. data L a = One a | Cons a (L a) -- non-empty list -- standard list monad instance Monad L where return = One

[Haskell-cafe] Re: class default method proposal

2007-12-13 Thread Jon Fairbairn
Duncan Coutts [EMAIL PROTECTED] writes: We all know that Functor should have been a superclass of Monad, and indeed we now know that Applicative should be too. Making such a change would break lots of things however so the change does not happen. However in this case the Monad operations can

[Haskell-cafe] Not sure where to send this: delivery failure to community.haskell.org

2007-12-13 Thread Magnus Therning
I received the following response when sending an email to [EMAIL PROTECTED] This is an automatically generated Delivery Status Notification THIS IS A WARNING MESSAGE ONLY. YOU DO NOT NEED TO RESEND YOUR MESSAGE. Delivery to the following recipient has been delayed: [EMAIL

[Haskell-cafe] Re: Software Tools in Haskell

2007-12-13 Thread apfelmus
Tommy M McGuire wrote: apfelmus wrote: tabwidth = 4 -- tabstop !! (col-1) == there is a tabstop at column col -- This is an infinite list, so no need to limit the line width tabstops = map (\col - col `mod` tabwidth == 1) [1..] -- calculate spaces needed to fill to the

[Haskell-cafe] Execution of external command

2007-12-13 Thread Bulat Ziganshin
Hello haskell-cafe, please help me with selection of proper function to use i need to run external command with parameter and get its stdout, smth like this: output - system cmd param the code should be compatible with unix and windows, and it should be possible to execute scripts (so afaiu it

Re: [Haskell-cafe] Execution of external command

2007-12-13 Thread Duncan Coutts
On Thu, 2007-12-13 at 15:48 +0300, Bulat Ziganshin wrote: Hello haskell-cafe, please help me with selection of proper function to use i need to run external command with parameter and get its stdout, smth like this: output - system cmd param the code should be compatible with unix

Re[2]: [Haskell-cafe] Execution of external command

2007-12-13 Thread Bulat Ziganshin
Hello Duncan, Thursday, December 13, 2007, 4:10:26 PM, you wrote: i need to run external command with parameter and get its stdout, smth temporary file. It seems it is not possible to use pipes to get the stdout and have the resulting code be portable between Haskell implementations (it's a

Re: [Haskell-cafe] Execution of external command

2007-12-13 Thread Yitzchak Gale
Hi Bulat, You wrote: please help me with selection of proper function to use i need to run external command with parameter and get its stdout, smth like this: output - system cmd param the code should be compatible with unix and windows, and it should be possible to execute scripts (so afaiu

Re: [Haskell-cafe] Execution of external command

2007-12-13 Thread Yitzchak Gale
so, do (stdin,stdout,stderr,ph) - runInteractiveCommand script param waitForProcess ph when i should read stdout? before or after waitForProcess? If you are sure that your script will behave nicely (or don't care if it doesn't), how about just: (_, h, _, _) - runInteractiveCommand script

Re[2]: [Haskell-cafe] Execution of external command

2007-12-13 Thread Bulat Ziganshin
Hello Yitzchak, Thursday, December 13, 2007, 4:36:48 PM, you wrote: waitForProcess ph when i should read stdout? before or after waitForProcess? If you are sure that your script will behave nicely (or don't care if it doesn't), how about just: (_, h, _, _) - runInteractiveCommand

Re: Re[2]: [Haskell-cafe] Execution of external command

2007-12-13 Thread Duncan Coutts
On Thu, 2007-12-13 at 16:27 +0300, Bulat Ziganshin wrote: Hello Duncan, Thursday, December 13, 2007, 4:10:26 PM, you wrote: i need to run external command with parameter and get its stdout, smth temporary file. It seems it is not possible to use pipes to get the stdout and have the

Re[4]: [Haskell-cafe] Execution of external command

2007-12-13 Thread Bulat Ziganshin
Hello Duncan, Thursday, December 13, 2007, 4:43:17 PM, you wrote: Use just the GHC bit from the code I pointed at: thank you, Duncan. are there any objections against simplest code proposed by Yitzchak? i.e. (_, h, _, _) - runInteractiveCommand script params output - hGetContents h taking

Re: [Haskell-cafe] Execution of external command

2007-12-13 Thread Duncan Coutts
On Thu, 2007-12-13 at 15:06 +0200, Yitzchak Gale wrote: Hi Bulat, You wrote: please help me with selection of proper function to use i need to run external command with parameter and get its stdout, smth like this: output - system cmd param the code should be compatible with

Re[2]: [Haskell-cafe] Execution of external command

2007-12-13 Thread Bulat Ziganshin
Hello gwern0, Thursday, December 13, 2007, 4:43:02 PM, you wrote: to get at stdout. I don't think this would go through cmd/sh, but honestly, specifying a particular interpreter breaks your portability anyway these scripts will be written by users so they don't need to be the same for

Re: Re[2]: [Haskell-cafe] Execution of external command

2007-12-13 Thread Yitzchak Gale
Bulat Ziganshin wrote: to Yitzchak: and you've asked what's wrong with runInteractiveCommand? :))) It was a good question. It prompted Duncan to post some really cool stuff, and we all learned something. -Yitz ___ Haskell-Cafe mailing list

Re: Re[2]: [Haskell-cafe] Execution of external command

2007-12-13 Thread Duncan Coutts
On Thu, 2007-12-13 at 17:08 +0300, Bulat Ziganshin wrote: Hello Duncan, Thursday, December 13, 2007, 4:51:20 PM, you wrote: OK, I'll bite. What's wrong with runInteractiveCommand? It requires threads because you have to pull from both the stdout and stderr to prevent blocking. You

Re: [Haskell-cafe] New slogan for haskell.org

2007-12-13 Thread Denis Bueno
On 12/12/07, Bill Wood [EMAIL PROTECTED] wrote: On Wed, 2007-12-12 at 11:19 +, Andrew Coppin wrote: . . . ...and normal programmers care about the Fibonacci numbers because...? Seriously, there are many, many programmers who don't even know what Fibonacci numbers *are*. And even I

Re[4]: [Haskell-cafe] Execution of external command

2007-12-13 Thread Bulat Ziganshin
Hello Duncan, Thursday, December 13, 2007, 5:38:24 PM, you wrote: Yep, that'll work. Spencer Janssen added that i should use waitForProcess - otherwise on unix it will leave a zombie Yitzchak, Duncan, gwern and Spencer. thank you very much for all your answers, i'm sure that i'll have much

Re: [Haskell-cafe] New slogan for haskell.org

2007-12-13 Thread Bill Wood
On Thu, 2007-12-13 at 09:55 -0500, Denis Bueno wrote: . . . More importantly for this discussion, however: Fibonacci heaps have nothing to do with calculating the fibonacci numbers, and you don't even need to know what the fibonacci sequence is to use fibonacci heaps. (You discover what it

[Haskell-cafe] Re: Execution of external command

2007-12-13 Thread Simon Marlow
Bulat Ziganshin wrote: Hello Duncan, Thursday, December 13, 2007, 4:43:17 PM, you wrote: Use just the GHC bit from the code I pointed at: thank you, Duncan. are there any objections against simplest code proposed by Yitzchak? i.e. (_, h, _, _) - runInteractiveCommand script params output -

Re: [Haskell-cafe] Re: Execution of external command

2007-12-13 Thread David Waern
2007/12/13, Simon Marlow [EMAIL PROTECTED]: Bulat Ziganshin wrote: Hello Duncan, Thursday, December 13, 2007, 4:43:17 PM, you wrote: Use just the GHC bit from the code I pointed at: thank you, Duncan. are there any objections against simplest code proposed by Yitzchak? i.e.

Re: [Haskell-cafe] Re: Execution of external command

2007-12-13 Thread Yitzchak Gale
Bulat Ziganshin wrote: ...are there any objections against... (_, h, _, _) - runInteractiveCommand script params output - hGetContents h taking into account that bad-behaved scripts are not my headache? bad-behaved scripts are not my headache is not the same as behave nicely. Or I guess

Re: [Haskell-cafe] Re: Execution of external command

2007-12-13 Thread Yitzchak Gale
(_,h,e,_) - runInteractiveCommand script params clearStderr output - hGetContents h where clearStderr is one of: 1. hClose e 2. hGetContents e = evaluate . last 3. forkIO (hGetContents e = evaluate . last return ()) all seem to work for me on Mac OS. Only 2 hangs on Debian testing. What

Re: [Haskell-cafe] Re: Execution of external command

2007-12-13 Thread Brandon S. Allbery KF8NH
On Dec 13, 2007, at 13:07 , Yitzchak Gale wrote: (_,h,e,_) - runInteractiveCommand script params clearStderr output - hGetContents h where clearStderr is one of: 1. hClose e 2. hGetContents e = evaluate . last 3. forkIO (hGetContents e = evaluate . last return ()) all seem to work for me

Re: [Haskell-cafe] Re: Execution of external command

2007-12-13 Thread Duncan Coutts
On Thu, 2007-12-13 at 19:38 +0200, Yitzchak Gale wrote: Simon Marlow wrote: It could deadlock if the script produces enough stderr to fill up its pipe buffer If we need to worry about that, then what about this: (_,h,e,_) - runInteractiveCommand script params forkIO (hGetContents e =

Re: [Haskell-cafe] Re: Execution of external command

2007-12-13 Thread Donn Cave
On Thu, 13 Dec 2007, Duncan Coutts wrote: ... Something simple would be to allow attaching a pipe to just the stdout and redirecting stderr elsewhere, or connecting both stdout and stderr to the same output pipe. runProcess allows substituting any of stdin/stdout/stderr for other Handles and

[Haskell-cafe] Hoogle error

2007-12-13 Thread jim burton
Hoogling (-) (=) gives Error, your search was invalid: Parse Error: Unexpected character '=)' Is there a way to escape the input so it would work? (I wasn't really expecting the right results BTW as I think hoogle searches type signatures not patterns in definitions, right?) Thanks, Jim

Re: [Haskell-cafe] Hoogle error

2007-12-13 Thread Neil Mitchell
Hi Hoogling (-) (=) gives Error, your search was invalid: Parse Error: Unexpected character '=)' Is there a way to escape the input so it would work? (I wasn't really expecting the right results BTW as I think hoogle searches type signatures not patterns in definitions, right?) What were

Re: [Haskell-cafe] Not sure where to send this: delivery failure to community.haskell.org

2007-12-13 Thread Ian Lynagh
Hi Magnus, On Thu, Dec 13, 2007 at 10:17:26AM +, Magnus Therning wrote: I received the following response when sending an email to [EMAIL PROTECTED] Delivery to the following recipient has been delayed: Thanks for letting us know. We've been having some trouble with community, and it

Re: [Haskell-cafe] Hoogle error

2007-12-13 Thread jim burton
On Thu, 2007-12-13 at 20:16 +, Neil Mitchell wrote: Hi Hoogling (-) (=) gives Error, your search was invalid: Parse Error: Unexpected character '=)' Is there a way to escape the input so it would work? (I wasn't really expecting the right results BTW as I think hoogle searches

[Haskell-cafe] Re: Problem with Gtk2hs

2007-12-13 Thread Ben Franksen
Andrew Coppin wrote: Duncan Coutts wrote: On Mon, 2007-12-10 at 10:40 +, Andrew Coppin wrote: What do I need to compile the darcs version? Just GHC? Or do I need the GTK+ header files? (Remember, I'm on Windows here.) Ah, that's a bit harder. It's not for the feint of heart.

Re: Re[2]: [Haskell-cafe] Execution of external command

2007-12-13 Thread Evan Laforge
it seems that script may be not terminated if its output isn't read, so better code should be (_, h, g, _) - runInteractiveCommand script params result - hGetLine h hGetContents h = evaluate.length hGetContents g = evaluate.length Tangent here, but does anyone else think that something

[Haskell-cafe] Monads that are Comonads and the role of Adjunction

2007-12-13 Thread Dan Weston
apfelmus wrote: Luke Palmer wrote: Isn't a type which is both a Monad and a Comonad just Identity? (I'm actually not sure, I'm just conjecting) Good idea, but it's not the case. data L a = One a | Cons a (L a) -- non-empty list Maybe I can entice you to elaborate slightly. From

Re: Re[2]: [Haskell-cafe] Execution of external command

2007-12-13 Thread Don Stewart
qdunkan: it seems that script may be not terminated if its output isn't read, so better code should be (_, h, g, _) - runInteractiveCommand script params result - hGetLine h hGetContents h = evaluate.length hGetContents g = evaluate.length Tangent here, but does anyone else think

Re: [Haskell-cafe] Problems with split-objs

2007-12-13 Thread Duncan Coutts
On Mon, 2007-11-26 at 22:48 +, Magnus Therning wrote: I've followed the instructions at [1] to create a .deb of vty[2]. It seems the helper scripts for Debian passes `--enable-split-obj' when running `./Setup.lhs configure'. This results in numerous multiple definitions of stuff. I

[Haskell-cafe] Re: re: generics and grammars

2007-12-13 Thread Chung-chieh Shan
Greg Meredith [EMAIL PROTECTED] wrote in article [EMAIL PROTECTED] in gmane.comp.lang.haskell.cafe: Thanks for the references! Have two-level types been applied to parser generation? Hrm, I'm not sure what kind of application you have in mind, so I suppose the answer is that I'm not aware of

[Haskell-cafe] -threaded

2007-12-13 Thread Maurí­cio
Hi, I see in the documentation and in many messages in this list that, if you want multithreading in your program, you need to use -threaded in ghc. Why isn't that option default? Does it imply some kind of overhead? Thanks, Maurício ___