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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 -
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.
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
(_,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
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
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 =
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
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
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
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
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
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.
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
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
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
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
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
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
___
37 matches
Mail list logo