Re: More suitable data structure needed

2002-08-20 Thread Ashley Yakeley
At 2002-08-21 01:14, Dr Mark H Phillips wrote: >But what is the best way to represent this in Haskell? (Clearly >I can't do exactly this, because Haskell requires all list elements >to be of the same type.) Create a new type that can allow either a pair or a list of pairs, and use a list of th

More suitable data structure needed

2002-08-20 Thread Dr Mark H Phillips
Hi, Consider the following data structure, effectively of type [[(Int,Int)]]: (2,5) (1,3) (2,0) (2,5) (1,2) (1,1) (1,0) (2,5) (3,1) (1,5) (2,4) (2,0) (1,5) (1,4) (1,3) (1,1) (1,0) (1,5) (1,4) (2,2) (1,0) (1,5) (1,4) (1,2) (2,1) (1,5) (2,3) (1,2) (1,0) (1,5) (2,3) (2,1) (1,5) (1,3) (2,2) (1,1) (1

Re: Evaluation order, ghc versus hugs, lazy vs. strict

2002-08-20 Thread Alastair Reid
>> More importantly, understand how foldl' works and be ready to apply >> the same analysis and fix to any similar function. > This is what I cannot do for the moment. How do I find out what is > really going on. Any pointers to a relevant articles/literature? Read the heap profiling papers fr

Re: GPH: RE: Concurrency and Haskell

2002-08-20 Thread mgross
On Tue, 20 Aug 2002 [EMAIL PROTECTED] wrote: > Speaking of GpH, I wonder how is GdH coming along? It seems > that the installation instruction on http://www.cee.hw.ac.uk/~dsg/gdh/ > is still incomplete... > > As far as I know, Mosix has nothing to do with PVM, so am I > right to say that GpH

Re: GPH: RE: Concurrency and Haskell

2002-08-20 Thread mgross
To reduce the amount of duplication, I'm going to assume that everyone copied on your original note to me reads the list and copy only the list. If you know someone on the copy list who does not read the list, please tell me, and I will individually copy them on appropriate future e-mail. On T

Re: GPH: RE: Concurrency and Haskell

2002-08-20 Thread paul
Speaking of GpH, I wonder how is GdH coming along? It seems that the installation instruction on http://www.cee.hw.ac.uk/~dsg/gdh/ is still incomplete... As far as I know, Mosix has nothing to do with PVM, so am I right to say that GpH still needs PVM even you use it on a Mosix cluster? Then what

Re: GPH: RE: Concurrency and Haskell

2002-08-20 Thread Phil Trinder
Murray, There are several parallel Haskell implementations: a survey of them has just appeared in Journal of Func. Prog Vols 4&5 (July & Sept 2002). Implementations are available for o Eden http://www.mathematik.uni-marburg.de/inf/eden/ o GpH http://www.cee.hw.ac.uk/~dsg/gph/ My group works o

Re: zipWith, zipWith3, zipWith4.... looks gawky, IMHO

2002-08-20 Thread Coeus
> Nice, except that operator names that start with ':' are constructors. > > Have you seen the paper "Do we need dependent types" > ? They do the same trick, and go > further. > > --Dylan > No; but now I have it. I do not know where to use zipWith8 instead of o

Re: listen/bind socket problem in GHC 5.04

2002-08-20 Thread paul
Thanks for the help, it works! I wonder why mkPortNumber is no longer in the socket API? Regards, .paul. On Tue, Aug 20, 2002 at 10:05:40AM +0100, Simon Marlow wrote: > > instead of > > let port' = PortNum port > > use > let port' = fromIntegral port > > The PortNumber type shou

RE: listen/bind socket problem in GHC 5.04

2002-08-20 Thread Simon Marlow
> I understand that GHC 5.04 has reoganized the network modules, > but somehow my code broke over GHC 5.04... > > prepareSocket addr port = do > s <- socket AF_INET Stream 6 > setSocketOption s ReuseAddr 1 > let port' = PortNum port > addr' <- case addr of > Just str ->

Re: Evaluation order, ghc versus hugs, lazy vs. strict

2002-08-20 Thread Jan Kybic
>As you've apparently discovered, the trick is to be lazy but not too >lazy. That is, you want to generate the list lazily but compute a >partial result (i.e., the running total of that part of the list >processed so far) strictly. Thanks for all reactions. Now my simplified examples indeed run