Re: [Haskell-cafe] createProcess running non-existent programs

2012-08-13 Thread Evan Laforge
On Sun, Aug 12, 2012 at 6:18 PM, Niklas Hambüchen m...@nh2.me wrote: I just came across the fact that running createProcess (proc asdfasdf []) with non-existing command asdfasdf returns perfectly fine handles. I would expect an exception. You can even hGetContents on stdout: You just

Re: [Haskell-cafe] createProcess running non-existent programs

2012-08-13 Thread Andrew Cowie
On Sun, 2012-08-12 at 23:18 -0700, Evan Laforge wrote: Yes, I ran into the same thing a while back. The problem is that the subprocess has already been forked off before it runs exec() and finds out the file doesn't exist. Given how astonishingly common it is to pass an invalid executable

Re: [Haskell-cafe] createProcess running non-existent programs

2012-08-13 Thread David Feuer
In Unix, at least, check, then act is generally considered unwise: 1. Something can go wrong between checking and acting. 2. You might not be checking the right thing(s). In this case, the fact that the file exists is not useful if you don't have permission to execute it. You may not be able to

Re: [Haskell-cafe] createProcess running non-existent programs

2012-08-13 Thread Alexander Kjeldaas
This isn't that hard - a pipe shouldn't be needed anymore. Just require a post-2003 glibc. fexecve is a system call in most BSDs. It is also implemented in glibc using a /proc hack. http://www.kernel.org/doc/man-pages/online/pages/man3/fexecve.3.html Apparently, there are proposals/RFCs to

[Haskell-cafe] ANNOUNCE: abacate and chuchu

2012-08-13 Thread Marco Túlio Pimenta Gontijo
Hi. I'm pleased to announce the first release of Abacate and Chuchu. Chuchu is a port of Ruby's Cucumber to Haskell, and Abacate is a parser for the Gherkin language, used by Cucumber. According to their web site, Cucumber lets software development teams describe how software should behave in

Re: [Haskell-cafe] createProcess running non-existent programs

2012-08-13 Thread Donn Cave
Quoth Evan Laforge qdun...@gmail.com, ... ... or at least make sure the haskell version doesn't suffer from problems fixed in the python one. Exactly. This morning I'm reading suggested solutions that would work only some of the time, or on only some platforms, which wouldn't be satisfactory

Re: [Haskell-cafe] createProcess running non-existent programs

2012-08-13 Thread Brandon Allbery
On Mon, Aug 13, 2012 at 7:26 AM, Alexander Kjeldaas alexander.kjeld...@gmail.com wrote: This isn't that hard - a pipe shouldn't be needed anymore. Just require a post-2003 glibc. So, we are desupporting the *BSDs and OS X (and Solaris etc.) now? glibc is only used on Linux and the Hurd

Re: [Haskell-cafe] createProcess running non-existent programs

2012-08-13 Thread Brandon Allbery
On Mon, Aug 13, 2012 at 10:23 AM, Donn Cave d...@avvanta.com wrote: Though speaking of platforms, I guess one large headache would be what to do about Microsoft operating systems. Given the unusual Microsoft provides APIs that work as is for this, by my understanding; it's the POSIX

Re: [Haskell-cafe] createProcess running non-existent programs

2012-08-13 Thread Donn Cave
Quoth Brandon Allbery allber...@gmail.com, On Mon, Aug 13, 2012 at 10:23 AM, Donn Cave d...@avvanta.com wrote: Though speaking of platforms, I guess one large headache would be what to do about Microsoft operating systems. Given the unusual Microsoft provides APIs that work as is for this,

Re: [Haskell-cafe] Possible bug in Criterion or Statistics package

2012-08-13 Thread Ryan Newton
Terrible! Quite sorry that this seems to be a bug in the monad-par library. I'm copying some of the other monad-par authors and we hopefully can get to the bottom of this. If it's not possible to create a smaller reproducer, is it possible to share the original test that triggers this problem?

Re: [Haskell-cafe] Possible bug in Criterion or Statistics package

2012-08-13 Thread Till Berger
Terrible! Quite sorry that this seems to be a bug in the monad-par library. I'm copying some of the other monad-par authors and we hopefully can get to the bottom of this. If it's not possible to create a smaller reproducer, is it possible to share the original test that triggers this problem?

Re: [Haskell-cafe] Possible bug in Criterion or Statistics package

2012-08-13 Thread Aleksey Khudyakov
On 13.08.2012 19:43, Ryan Newton wrote: Terrible! Quite sorry that this seems to be a bug in the monad-par library. I'm copying some of the other monad-par authors and we hopefully can get to the bottom of this. If it's not possible to create a smaller reproducer, is it possible to share the

Re: [Haskell-cafe] Possible bug in Criterion or Statistics package

2012-08-13 Thread Aleksey Khudyakov
On 13.08.2012 20:26, Till Berger wrote: Terrible! Quite sorry that this seems to be a bug in the monad-par library. I'm copying some of the other monad-par authors and we hopefully can get to the bottom of this. If it's not possible to create a smaller reproducer, is it possible to share the

Re: [Haskell-cafe] Data structure containing elements which are instances of the same type class

2012-08-13 Thread Johan Holmquist
That pattern looks so familiar. :) Existential types seem to fit in to the type system really well so I never got why it is not part of the standard. On Aug 12, 2012 10:36 AM, Daniel Trstenjak daniel.trsten...@gmail.com wrote: Hi Oleg, On Sat, Aug 11, 2012 at 08:14:47AM -, o...@okmij.org

Re: [Haskell-cafe] Fixity declaration extension

2012-08-13 Thread Ryan Ingram
When I was implementing a toy functional languages compiler I did away with precedence declarations by number and instead allowed the programmer to specify a partial order on declarations; this seems to be a much cleaner solution and avoids arbitrary precedences between otherwise unrelated

Re: [Haskell-cafe] Data structure containing elements which are instances of the same type class

2012-08-13 Thread Jay Sulzberger
On Mon, 13 Aug 2012, Johan Holmquist holmi...@gmail.com wrote: That pattern looks so familiar. :) Existential types seem to fit in to the type system really well so I never got why it is not part of the standard. On Aug 12, 2012 10:36 AM, Daniel Trstenjak daniel.trsten...@gmail.com wrote:

Re: [Haskell-cafe] Fwd: 'let' keyword optional in do notation?

2012-08-13 Thread Ryan Ingram
But it would be in line with - bindings in the do notation, so maybe it wouldn't feel so wrong. I was about to post this exact example. do x - return 1 x - return x return x seems to work just fine (the answer is 1). I'd even be ok with =-in-do being non-recursive like - -- ryan On

Re: [Haskell-cafe] I use cabal install repa but then WinGHCi says module Data.Array.Rep.Algorithms.Ramdomish not found.

2012-08-13 Thread KC
The install of repa-algorithms fails saying it can't cannot find an llvm. In any case why can't the install syntax be cabal install repa.algorithms then it would be more consistent with the import statement. On Sun, Aug 12, 2012 at 4:00 PM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com

Re: [Haskell-cafe] I use cabal install repa but then WinGHCi says module Data.Array.Rep.Algorithms.Ramdomish not found.

2012-08-13 Thread mukesh tiwari
llvm is backend for repa package. Try to install llvm on you system. I think this can be helpful ( http://llvm.org/releases/3.0/docs/GettingStarted.html ). Mukesh Tiwari On Tue, Aug 14, 2012 at 2:47 AM, KC kc1...@gmail.com wrote: The install of repa-algorithms fails saying it can't cannot find

Re: [Haskell-cafe] 3 level hierarchy of Haskell objects

2012-08-13 Thread Jay Sulzberger
On Thu, 9 Aug 2012, wren ng thornton w...@freegeek.org wrote: On 8/8/12 9:41 PM, Jay Sulzberger wrote: Haskell's type classes look to me to be a provision for declaring a signature in the sense of the above article. Just to clarify this in the context of my previous post, type classes

Re: [Haskell-cafe] createProcess running non-existent programs

2012-08-13 Thread Richard O'Keefe
On 13/08/2012, at 11:26 PM, Alexander Kjeldaas wrote: This isn't that hard - a pipe shouldn't be needed anymore. Just require a post-2003 glibc. fexecve is a system call in most BSDs. It is also implemented in glibc using a /proc hack. fexecve is now in the Single Unix

Re: [Haskell-cafe] Data structure containing elements which are instances of the same type class

2012-08-13 Thread Ryan Ingram
On Mon, Aug 13, 2012 at 12:30 PM, Jay Sulzberger j...@panix.com wrote: Does Haskell have a word for existential type declaration? I have the impression, and this must be wrong, that forall does double duty, that is, it declares a for all in some sense like the usual for all of the Lower

[Haskell-cafe] Flipping type constructors

2012-08-13 Thread Tony Morris
I have a data-type that is similar to EitherT, however, I have ordered the type variables like so: data EitherT (f :: * - *) (a :: *) (b :: *) = ... This allows me to declare some desirable instances: instance Functor f = Bifunctor (EitherT f) instance Foldable f = Bifoldable (EitherT f)

Re: [Haskell-cafe] Fixity declaration extension

2012-08-13 Thread AntC
Ryan Ingram ryani.spam at gmail.com writes: When I was implementing a toy functional languages compiler I did away with precedence declarations by number and instead allowed the programmer to specify a partial order on declarations; this seems to be a much cleaner solution and avoids

Re: [Haskell-cafe] Data structure containing elements which are instances of the same type class

2012-08-13 Thread Jay Sulzberger
On Mon, 13 Aug 2012, Ryan Ingram ryani.s...@gmail.com wrote: On Mon, Aug 13, 2012 at 12:30 PM, Jay Sulzberger j...@panix.com wrote: Does Haskell have a word for existential type declaration? I have the impression, and this must be wrong, that forall does double duty, that is, it declares a

Re: [Haskell-cafe] Data structure containing elements which are instances of the same type class

2012-08-13 Thread Alexander Solla
On Mon, Aug 13, 2012 at 6:25 PM, Jay Sulzberger j...@panix.com wrote: On Mon, 13 Aug 2012, Ryan Ingram ryani.s...@gmail.com wrote: On Mon, Aug 13, 2012 at 12:30 PM, Jay Sulzberger j...@panix.com wrote: Does Haskell have a word for existential type declaration? I have the impression,

Re: [Haskell-cafe] Data structure containing elements which are instances of the same type class

2012-08-13 Thread Jay Sulzberger
On Mon, 13 Aug 2012, Alexander Solla alex.so...@gmail.com wrote: On Mon, Aug 13, 2012 at 6:25 PM, Jay Sulzberger j...@panix.com wrote: On Mon, 13 Aug 2012, Ryan Ingram ryani.s...@gmail.com wrote: On Mon, Aug 13, 2012 at 12:30 PM, Jay Sulzberger j...@panix.com wrote: Does Haskell have