Re: Bug in IO libraries when sending data through a pipe?

2002-03-19 Thread Jens Petersen
Jens Petersen <[EMAIL PROTECTED]> writes: > > The problem is that the child process doesn't receive all the data which > > the parent sends. It's as if "hPutStr vonh txt" sends the data lazily > > somehow, and "hClose vonh" closes the pipe prematurely. > > > > It varies from run to run exactly w

Re: finding ....

2002-03-19 Thread David Sankel
--- Pixel <[EMAIL PROTECTED]> wrote: > Lennart Augustsson <[EMAIL PROTECTED]> writes: > > > > Diego Yanivello wrote: > > > > > > > hi,is there (in Haskell) a function like > existFile :: FilePath -> > > > > IO (Bool) ? Thanks! > > > > Using such a function is generally a bad idea > b

Re: finding ....

2002-03-19 Thread Lennart Augustsson
Thank you for making my point. All these are indeed examples of broken code. (Not because it's Perl. :) -- Lennart Pixel wrote: > Lennart Augustsson <[EMAIL PROTECTED]> writes: > > > Just because many applications use this doesn't make it safe or good. > > Presumably you are testing for th

Re: finding ....

2002-03-19 Thread Pixel
Lennart Augustsson <[EMAIL PROTECTED]> writes: > Just because many applications use this doesn't make it safe or good. > Presumably you are testing for the existence of the file to do something > to it (read, create, delete...). It's better to do the operation you want to > do and have it fail i

Re: finding ....

2002-03-19 Thread Lennart Augustsson
Just because many applications use this doesn't make it safe or good. Presumably you are testing for the existence of the file to do something to it (read, create, delete...). It's better to do the operation you want to do and have it fail if the file is missing (or existing if you create). You

finding ....

2002-03-19 Thread Diego Yanivello
hi,     is there (in Haskell) a function like       existFile :: FilePath -> IO (Bool) ?   Thanks!

Empirical Software Engineering: An International Journal - CALL FOR PAPERS

2002-03-19 Thread ESEJournal
*** Empirical Software Engineering: An International Journal - CALL FOR PAPERS - *** http://www.kluweronline.com/issn/1382-3256 . Co

Re: Haskell slicing tool?

2002-03-19 Thread Sengan . Baring-Gould
On Tue, 19 Mar 2002 09:56:49 + "Colin Runciman" <[EMAIL PROTECTED]> wrote: > > Are there any tools to perform program slicing on Haskell? > > I often find myself wanting to find all "fromJusts" invoked > > from the current function, or all functions that use a > > particular member of my mona

Re: Haskell puzzles!

2002-03-19 Thread Jan-Willem Maessen
Daan Leijen writes: > 1) Are e1 and e2 equal? > > > f (x:xs) y = x > > g (x:xs)= \y -> x > > > > e1 = seq (f []) 1 > > e2 = seq (g []) 1 > ... > 1) > answer: > "e1" equals the value 1, while "e2" is undefined. > ... > opinion: > I think that the pattern matching translation rules > a

Haskell puzzles!

2002-03-19 Thread Daan Leijen
Hi all, I have put together some interesting Haskell puzzles! Not many people were able to solve all three puzzles so don't be discouraged you don't know all the answers. Have fun, Daan. - - All three puzzles are "Haskell 98"; you can solve

RE: question about concurrency implementation

2002-03-19 Thread Simon Peyton-Jones
Dean | From Simon Marlow's reply, I gather that the current | implementations of Concurrent Haskell provide "concurrency" | but not "parallelism", and that provision of parallelism is | not likely in the near term. That's more or less right. The trouble is that for shared-memory parallelism

Gaussian integers. Reply

2002-03-19 Thread S.D.Mechveliani
[EMAIL PROTECTED] writes > On holiday, I started reading about Gaussian integers (as you do) and I > thought this should be a piece of cake for Haskell. I get the following > error in Hugs: > [..] > > data Integral a => Gaussian a = Gaussian a a > deriving (Eq, Show) > > instance Num (Gaussia

Re: Gaussian Integers

2002-03-19 Thread Janis Voigtlaender
[EMAIL PROTECTED] wrote: > I've already declared Gaussian a as being of class Eq so why does it need > to be told again? > > data Integral a => Gaussian a = Gaussian a a >deriving (Eq, Show) > > instance Num (Gaussian a) where >Gaussian a b - Gaussian a' b' = Gaussian (a-a') (b-b') >

Gaussian Integers

2002-03-19 Thread dominic . j . steinitz
On holiday, I started reading about Gaussian integers (as you do) and I thought this should be a piece of cake for Haskell. I get the following error in Hugs: ERROR "D:\Temp\comptst2.hs" (line 4): Cannot build superclass instance *** Instance: Num (Gaussian a) *** Context supplied

Re: using less stack

2002-03-19 Thread Amanda Clare
Thanks for all the advice. In the end, I couldn't make $! work for me (it always seems to be harder than I think it will be to use it, and $! and deepSeq makes my code run slowly). But a continuation passing style foldl worked wonderfully. I now have: > cpsfold f a [] = a > cpsfold f a (x:x

re: Haskell slicing tool?

2002-03-19 Thread Colin Runciman
> Are there any tools to perform program slicing on Haskell? > I often find myself wanting to find all "fromJusts" invoked > from the current function, or all functions that use a > particular member of my monad's ADT. Assuming that what you want to see are the applications of these functions tha