[Haskell-cafe] generic sum for an UArr

2009-03-11 Thread Manlio Perillo
Hi. I have an array (Data.Array.Vector.UArr) of Word8 elements. Elements are stored as Word8 to keep memory usage down. Now I need to compute the sum of all the array elements; what is the best method? The sum must be of type Int. How efficient is to simply convert to an UArr Int, using:

Re: [Haskell-cafe] generic sum for an UArr

2009-03-11 Thread Manlio Perillo
Daniel Fischer ha scritto: [...] genericSumU :: (UA e, Integral e) = UArr e - Int genericSumU = foldU add 0 That would have to be foldlU, the type of foldU is foldU :: UA a = (a - a - a) - a - UArr a - a while foldlU :: UA a = (b - a - b) - b - UArr a - b Damn... I was reading

[Haskell-cafe] Style Guide for Haskell Code

2009-03-10 Thread Manlio Perillo
://github.com/tibbe/haskell-style-guide/tree/master and, of course, the GHC style guide. Any plans for a common document? Thanks Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] ByteString in patterns

2009-03-10 Thread Manlio Perillo
Hi. Using normal String type I can define a pattern like: let foo baz = 777 foo baz 777 But if I want to use ByteString, what should I do? This seems impossible, since ByteString data constructor is not available. Thanks Manlio Perillo

Re: [Haskell-cafe] ByteString in patterns

2009-03-10 Thread Manlio Perillo
Don Stewart ha scritto: manlio_perillo: Hi. Using normal String type I can define a pattern like: let foo baz = 777 foo baz 777 But if I want to use ByteString, what should I do? This seems impossible, since ByteString data constructor is not available. -XOverloadedStrings Perfect,

Re: [Haskell-cafe] ByteString in patterns

2009-03-10 Thread Manlio Perillo
Don Stewart ha scritto: [...] -XOverloadedStrings Perfect, thanks. Is this supported by other Haskell implementations, or planned for Haskell'? Not as far as I know. It was added to GHC just over 2 years ago, http://article.gmane.org/gmane.comp.lang.haskell.cvs.all/31022 and isn't

Re: [Haskell-cafe] ByteString in patterns

2009-03-10 Thread Manlio Perillo
instance declarations for IsString class are not defined for available ByteStrings? I need to define it by myself. Thanks Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Cabal and package changelog

2009-03-08 Thread Manlio Perillo
. Is this feasible? Thanks Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Cabal and package changelog

2009-03-08 Thread Manlio Perillo
Duncan Coutts ha scritto: On Sun, 2009-03-08 at 10:00 -0400, Gwern Branwen wrote: On Sun, Mar 8, 2009 at 7:13 AM, Manlio Perillo manlio_peri...@libero.it wrote: Hi. The Cabal package description includes a property `license-file`. This property may be used by Hackage to provide a link

Re: [Haskell-cafe] help optimizing memory usage for a program

2009-03-05 Thread Manlio Perillo
it to hackage, if it can be useful. What name should I use? How should I categorize it? Regards Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] monadic MapReduce

2009-03-05 Thread Manlio Perillo
Anish Muttreja ha scritto: [...] How about this. Is there a reason why I can't replace the variables b and c in the type signature of mapReduce with with (IO b') and (IO c'). b and c can be any types. mapReduce :: Strategy (IO b')-- evaluation strategy for mapping - (a - IO

Re: [Haskell-cafe] possible memory leak in uvector 0.1.0.3

2009-03-05 Thread Manlio Perillo
this by 3 to account for copying GC behavior Ok, this explains memory usage; thanks. IMHO, this informations should go in the wiki; they may be insignificant for normal applications, but when one starts to deal with huge amount of data, 10 bytes per item make an important difference. Manlio

[Haskell-cafe] missing support to Data.Binary for uvector package

2009-03-05 Thread Manlio Perillo
)) Thanks Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] possible memory leak in uvector 0.1.0.3

2009-03-03 Thread Manlio Perillo
Manlio Perillo ha scritto: [...] The other program, with a lot of array concatenations, still eats a lot of memory... Concatenating arrays generally copies data. Which uses memory. Of course, but why the garbage collector does not release this temporary used memory? Note that I'm using

Re: [Haskell-cafe] possible memory leak in uvector 0.1.0.3

2009-03-03 Thread Manlio Perillo
Peter Verswyvelen ha scritto: Does esist a data structure that is able to store something like 480189 keys with efficient memory usage? What is the range of your keys - do they use the full 32-bit of Int - and what type are the values? From Netflix Prize documentation: CustomerIDs range

Re: [Haskell-cafe] possible memory leak in uvector 0.1.0.3

2009-03-03 Thread Manlio Perillo
Duncan Coutts ha scritto: On Tue, 2009-03-03 at 02:12 +0100, Manlio Perillo wrote: Hi. In the help optimizing memory usage for a program I discovered some interesting things: 1) Using lazy ByteStrings to read files it not a good choice, since the garbage collector is not able to proper

Re: [Haskell-cafe] possible memory leak in uvector 0.1.0.3

2009-03-03 Thread Manlio Perillo
Rating) -- UArr from uvector Code is here: http://haskell.mperillo.ath.cx/netflix-0.0.1.tar.gz but it is an old version (where I used lazy ByteString). Thanks Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http

Re: [Haskell-cafe] possible memory leak in uvector 0.1.0.3

2009-03-03 Thread Manlio Perillo
Daniel Fischer ha scritto: Am Dienstag, 3. März 2009 15:35 schrieb Manlio Perillo: Claus Reinke ha scritto: At first guess it sounds like you're holding onto too much, if not the whole stream perhaps bits within each chunk. It is possible. I split the string in lines, then map some functions

Re: [Haskell-cafe] possible memory leak in uvector 0.1.0.3

2009-03-03 Thread Manlio Perillo
Claus Reinke ha scritto: I split the string in lines, then map some functions on each line to parse the data, and finally calling toU, for converting to an UArr. Just to make sure (code fragments or, better, reduced examples would make it easier to see what the discussion is about): are you

Re: [Haskell-cafe] Re: Left fold enumerator - a real pearl overlooked?

2009-03-02 Thread Manlio Perillo
path ReadMode parse' where parse' :: Handle - IO (UArr Xxx) parse' handle = do contents - L.hGetContents handle let v = toU $ xxx $ L.lines contents rnf v `seq` return v All the file is consumed, before the result is returned. [...] Manlio Perillo

Re: [Haskell-cafe] Re: Left fold enumerator - a real pearl overlooked?

2009-03-02 Thread Manlio Perillo
Bayley, Alistair ha scritto: From: haskell-cafe-boun...@haskell.org [mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Manlio Perillo Sent: 02 March 2009 11:01 Eugene Kirpichov ha scritto: I'm not considering the lazy IO approach, as it doesn't involve any form of control over resources

Re: [Haskell-cafe] monadic MapReduce

2009-03-02 Thread Manlio Perillo
Anish Muttreja ha scritto: On Sun, Mar 01, 2009 at 07:25:56PM +0100, Manlio Perillo wrote: Hi. I have a function that do some IO (take a file path, read the file, parse, and return some data), and I would like to parallelize it, so that multiple files can be parsed in parallel. I would

[Haskell-cafe] help optimizing memory usage for a program

2009-03-02 Thread Manlio Perillo
tests with recent GHC versions, but it may be a problem. Thanks Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] help optimizing memory usage for a program

2009-03-02 Thread Manlio Perillo
usage. Thanks Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] help optimizing memory usage for a program

2009-03-02 Thread Manlio Perillo
efficient. [2] versus 17770 files with ratings grouped by movies Regards Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] help optimizing memory usage for a program

2009-03-02 Thread Manlio Perillo
Manlio Perillo ha scritto: [...] moreover, you may set upgrowing factor. with a g.f. of 1.5, for example, memory will be collected once heap will become 1.5x larger than real memory usage after last GC. this effectively guarantees that memory overhead will never be over this factor Thanks

Re: [Haskell-cafe] help optimizing memory usage for a program

2009-03-02 Thread Manlio Perillo
Kenneth Hoste ha scritto: [...] The 26m/700MB I mentioned on my blog was on my ancient PowerBook G4 (1.5GHz PowerPC G4, 1.25G). I redid the same experiment on our iMac (Core2 Duo, 2.0 GHz, 3.0G), i.e.: - read in all the data - count the number of keys in the IntMap (which should be 17,770,

Re: [Haskell-cafe] help optimizing memory usage for a program

2009-03-02 Thread Manlio Perillo
Manlio Perillo ha scritto: [...] I have executed the program, using the same RTS flags as yours: real6m13.523s user0m53.931s sys0m7.812s 815 MB usage This is an huge improvement! Now I have to check if using insert will further improve memory usage. And ... surprise

Re: [Haskell-cafe] help optimizing memory usage for a program

2009-03-02 Thread Manlio Perillo
Manlio Perillo ha scritto: Manlio Perillo ha scritto: [...] I have executed the program, using the same RTS flags as yours: real6m13.523s user0m53.931s sys0m7.812s 815 MB usage This is an huge improvement! Using UArray and empty + insert: real 5m40.732s user

[Haskell-cafe] possible memory leak in uvector 0.1.0.3

2009-03-02 Thread Manlio Perillo
... Thanks Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] possible memory leak in uvector 0.1.0.3

2009-03-02 Thread Manlio Perillo
... Concatenating arrays generally copies data. Which uses memory. Of course, but why the garbage collector does not release this temporary used memory? Note that I'm using the -F1 flag with the RST. Maybe it is a problem with IntMap, when there are a lot of keys? Thanks Manlio Perillo

Re: [Haskell-cafe] differences between Data.Array and Data.Vector

2009-03-01 Thread Manlio Perillo
fusible, or both. For the uvector package, how efficient is snocU? In the documentation there are no notes about performance. Thanks Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo

Re: [Haskell-cafe] ANNOUNCE: text and text-icu, fast and comprehensive Unicode support using stream fusion

2009-03-01 Thread Manlio Perillo
Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] memory-efficient data type for Netflix data - UArray Int Int vs UArray Int Word8

2009-03-01 Thread Manlio Perillo
bytes to store both the ID and the rating. Maybe it is the garbage collector that does not release memory to the operating system? Thanks Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo

[Haskell-cafe] odd problem with export list of System.IO

2009-03-01 Thread Manlio Perillo
Hi. Maybe I'm missing something, but I don't understand why the following program: module Main where import System.IO (Handle, withFile, ReadMode) main = do return fails to compile, with a Module `System.IO' does not export `ReadMode' Thanks Manlio Perillo

Re: [Haskell-cafe] odd problem with export list of System.IO

2009-03-01 Thread Manlio Perillo
Johan Tibell ha scritto: On Sun, Mar 1, 2009 at 3:07 PM, Manlio Perillo manlio_peri...@libero.it wrote: Hi. Maybe I'm missing something, but I don't understand why the following program: module Main where import System.IO (Handle, withFile, ReadMode) You want to import IOMode

[Haskell-cafe] Cabal and `main-is` field

2009-03-01 Thread Manlio Perillo
Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Cabal and `main-is` field

2009-03-01 Thread Manlio Perillo
in the top-level build-depends, they don't need to declare it. Thanks. From documentation it was not clear this feature. However, what happens if hxput add a build-depends field? Will this override the global field? Manlio Perillo ___ Haskell-Cafe mailing

[Haskell-cafe] monadic MapReduce

2009-03-01 Thread Manlio Perillo
= mapResult `pseq` reduceResult where mapResult= parMap mapStrat mapFunc input reduceResult = reduceFunc mapResult `using` reduceStrat Is this possible? Thanks Manlio Perillo I ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Cabal and `main-is` field

2009-03-01 Thread Manlio Perillo
as we might fix it. Thanks, I was going to fix my Cabal configuration right now! Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] controlling timeout for Network.Socket.connect - how?

2009-02-28 Thread Manlio Perillo
of network programming. You may check the Twisted framework (if you know Python) to see a sample implementation). Manlio Perillo It doesn't depend from being safe/unsafe FFI-ed, does it? Belka ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http

[Haskell-cafe] missing support for NFData in uvector package

2009-02-28 Thread Manlio Perillo
of two arrays, and plain `seq` did not worked. Regards Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] memory-efficient data type for Netflix data - UArray Int Int vs UArray Int Word8

2009-02-26 Thread Manlio Perillo
efficient it is, however. By the way, about uvector: it has a Stream data type, and you can build a vector from a stream. But how this work and how (if any) the stream data is integrated with other packages? The package documentations seems to be still incomplete. [...] Regards Manlio

Re: [Haskell-cafe] memory-efficient data type for Netflix data - UArray Int Int vs UArray Int Word8

2009-02-26 Thread Manlio Perillo
Kenneth Hoste ha scritto: [...] However, as I posted yesterday, I've been able to circumvent the issue by rethinking my data type, i.e. using the ~18K movie IDs as key instead of the 480K user IDs, which radically limits the overhead... Well, but what if you really need the original data

[Haskell-cafe] differences between Data.Array and Data.Vector

2009-02-25 Thread Manlio Perillo
Hi. In Hackage there are some packages named *array*, and others named *vector*. What are the differences? Is available a guide to the various data structures available in Haskell? Thanks Manlio Perillo ___ Haskell-Cafe mailing list Haskell

[Haskell-cafe] popularity context with Cabal

2009-02-25 Thread Manlio Perillo
was used less than thirty days ago. This computation is performed by the popcon server. Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] controlling timeout for Network.Socket.connect - how?

2009-02-24 Thread Manlio Perillo
is to set the socket to non blocking mode, and use select (or poll/epoll/kqueue). [...] Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-21 Thread Manlio Perillo
, a more viable solution is to write the *parser* in GHC, but use the raw code written in C. As an example, I get some problems from mplayer, not caused by the codec, but by the demuxer and stream parsing. Manlio Perillo ___ Haskell-Cafe mailing

Re: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Manlio Perillo
0.892 ghc -funroll-loops -D80.623 gcc -O3 -funroll-loops 0.318 ghc -funroll-loops -D64 0.088 As a full comparison I would like to see time for ghc -O0 naive left fold Manlio Perillo

Re: [Haskell-cafe] Can this be done?

2009-02-11 Thread Manlio Perillo
Cristiano Paris ha scritto: On Wed, Feb 11, 2009 at 2:30 PM, Peter Verswyvelen bugf...@gmail.com wrote: I haven't looked at the details, but I think this is what a library like Reactive from Conal Elliott could do, but as far as I understand it, it is still work in progress. I'm interested in

Re: [Haskell-cafe] Can this be done?

2009-02-11 Thread Manlio Perillo
John Goerzen ha scritto: [...] There were also issues with people using the back button. It reminded me a fair bit of the issues I ran into when using Python's Twisted framework, actually. Same experience, with Twisted Web + Nevow. All solved after switching to WSGI and a simple WSGI

Re: [Haskell-cafe] Can this be done?

2009-02-11 Thread Manlio Perillo
Manlio Perillo ha scritto: The only thing I miss is a little higher level of abstraction. Right now I operate on request bodies (in a text format, usually request body should be replaced with response body Manlio ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Why does sleep not work?

2009-02-10 Thread Manlio Perillo
[]) write(1, 5\n..., 2) = 2 So, it seems nanosleep get interruped by a signal. Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Why does sleep not work?

2009-02-10 Thread Manlio Perillo
Corey O'Connor ha scritto: 2009/2/10 George Pollard por...@porg.es: import System.Posix main = do putStrLn Waiting for 5 seconds. blockSignals $ addSignal sigVTALRM emptySignalSet sleep 5 putStrLn Done. Huh! Does the GHC runtime uses this signal? Perhaps for

Re: [Haskell-cafe] Why does sleep not work?

2009-02-10 Thread Manlio Perillo
George Pollard ha scritto: [...] So, it seems nanosleep get interruped by a signal. This works: import System.Posix main = do putStrLn Waiting for 5 seconds. blockSignals $ addSignal sigVTALRM emptySignalSet sleep 5 putStrLn Done. So (see my earlier

[Haskell-cafe] HSGI: Haskell Server Gateway Interface

2009-02-07 Thread Manlio Perillo
the first one - HSGI - available at the moment) are available here: http://mperillo.ath.cx/haskell/ Thanks and regards Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] HSGI: Haskell Server Gateway Interface

2009-02-07 Thread Manlio Perillo
... As a last note: I have some doubts about the name, since gateway is not in it ;-). Regards Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] HSGI: Haskell Server Gateway Interface

2009-02-07 Thread Manlio Perillo
Felix Martini ha scritto: Hi Manlio, Have you looked at http://www.haskell.org/haskellwiki/WebApplicationInterface ? If you did is there something in that proposal that you think should be changed or is not clear? There is currently a lot of interest in writing web frameworks for Haskell and it

Re: [Haskell-cafe] about integer and float operations

2009-02-06 Thread Manlio Perillo
Henning Thielemann ha scritto: On Thu, 5 Feb 2009, Manlio Perillo wrote: Yitzchak Gale ha scritto: Ah, OK. Thanks. Now we have a well-defined problem. :) Good :). I have used this example to describe how to avoid big integers at all: http://haskell.org/haskellwiki

Re: [Haskell-cafe] about integer and float operations

2009-02-05 Thread Manlio Perillo
using the existing fromRational specialization by constructing a Rational directly. I know that Haskell allows declaration hiding for program safety, but sometimes this can be a nuisance. [...] Thanks Manlio Perillo ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] about integer and float operations

2009-02-05 Thread Manlio Perillo
Richard O'Keefe ha scritto: On 5 Feb 2009, at 10:38 am, Manlio Perillo wrote: I'm looking for an exact integer division that avoids overflows, if possible. What this sounds like to me is a request that the Prelude function 'fromRational' should work well. Just found that it actually

Re: [Haskell-cafe] about integer and float operations

2009-02-05 Thread Manlio Perillo
Jonathan Cast ha scritto: On Thu, 2009-02-05 at 01:10 +0100, Manlio Perillo wrote: Yitzchak Gale ha scritto: In our case, the Python division first does a quick estimate of the sizes of the two integers, and just returns zero if it sees that there will be underflow on conversion to double. So

[Haskell-cafe] about integer and float operations

2009-02-04 Thread Manlio Perillo
and true integer division in CPython are robust, but there is some important reason why these operations are not supported in Haskell? Thanks Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman

Re: [Haskell-cafe] about integer and float operations

2009-02-04 Thread Manlio Perillo
Yitzchak Gale ha scritto: Manlio Perillo wrote: [...] The second difference is about the division of two integers. fac(777) / fac(777) 1.0 Here CPython does not convert the two integers to float before to divide them, but make use of a special algorithm. GHC, instead, returns NaN

Re: [Haskell-cafe] about integer and float operations

2009-02-04 Thread Manlio Perillo
Manlio Perillo ha scritto: [...] I personally prefer the Python solution, where we have two operators with the same behaviour over all the numbers. In Haskell, something like (/) :: (Num a, Real b) = a - a - b This should be (/) :: (Num a, Fractional b) = a - a - b but I'm not sure

Re: [Haskell-cafe] about integer and float operations

2009-02-04 Thread Manlio Perillo
for? No. I'm looking for an exact integer division that avoids overflows, if possible. -Ross Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] about integer and float operations

2009-02-04 Thread Manlio Perillo
it takes 30 seconds. Thanks Manlio Perillo [1] http://upload.wikimedia.org/math/6/6/8/6681cd21f3ca9bf13248a87d4202e06a.png ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] about integer and float operations

2009-02-04 Thread Manlio Perillo
Yitzchak Gale ha scritto: Manlio Perillo wrote: No. I'm looking for... Manlio - can you describe exactly what you want? Do you know exactly what you want? You have said that you want division like in Python - but that even that is not well defined: Python 2.6.1 3/5 0 You have to: from

Re: [Haskell-cafe] about integer and float operations

2009-02-04 Thread Manlio Perillo
from machine int to machine float will never overflow). For a long integer it uses a special algorithm for computing the division, that avoids overflow if the final result is in the range of a float. http://code.python.org/hg/trunk/file/tip/Objects/longobject.c#l2657 [...] Thanks Manlio

Re: [Haskell-cafe] about integer and float operations

2009-02-04 Thread Manlio Perillo
Manlio Perillo ha scritto: [...] Here is an Haskell version: http://paste.pocoo.org/show/102801/ On my system it takes 30 seconds. Sorry, I compiled without optimizations enabled. With -O2 it now runs in 20 seconds. What other optimizations should I enable? Thanks Manlio Perillo

Re: [Haskell-cafe] about integer and float operations

2009-02-04 Thread Manlio Perillo
get Nan as result, since fromIntegral a, when a is out of range of a double, returns Infinity. Prelude (fromIntegral (fac 777)) :: Double Infinity CPython, does not try to convert to double, but, instead, to a scaled double. --Max Manlio Perillo

Re: [Haskell-cafe] about integer and float operations

2009-02-04 Thread Manlio Perillo
Thomas DuBuisson ha scritto: What other optimizations should I enable? -fexcess-precision or some such There is pratically no performance gain (maybe about 1 second). Thanks Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] about integer and float operations

2009-02-04 Thread Manlio Perillo
Yitzchak Gale ha scritto: Manlio Perillo wrote: However there is still a *big* problem: it is inefficient. Here is a Python version of the Chudnovsky algorithm [1] for computing Pi: http://paste.pocoo.org/show/102800/ On my system it takes 10 seconds. Here is an Haskell version: http

Re: [Haskell-cafe] UDP

2009-02-02 Thread Manlio Perillo
Stevens. Regards Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] some ideas for Haskell', from Python

2009-01-16 Thread Manlio Perillo
interesting language. I also have support for pure functions. Regards Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] about documentation improvements

2009-01-16 Thread Manlio Perillo
it again Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] about documentation improvements

2009-01-16 Thread Manlio Perillo
Duncan Coutts ha scritto: On Fri, 2009-01-16 at 15:12 +0100, Manlio Perillo wrote: About latest thread on better naming and documentation improvement, why don't organize an interactive session where: 1) normal users tell what's wrong about a package/module documentation 2) the package/module

Re: [Haskell-cafe] some ideas for Haskell', from Python

2009-01-15 Thread Manlio Perillo
Artyom Shalkhakov ha scritto: Hi Manlio, Hi Artyom. Note that it seems you have sent this message only to me; I'm sending the reply to both you and the mailing list. 2009/1/14 Manlio Perillo manlio_peri...@libero.it: 2) In Python it is possible to import modules inside a function

Re: [Haskell-cafe] some ideas for Haskell', from Python

2009-01-15 Thread Manlio Perillo
to resolve. This is interesting. Where can I find some examples? Is this explained in the Real World Haskell book? Thanks Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] about System.Posix.Files.fileAccess

2009-01-15 Thread Manlio Perillo
Brandon S. Allbery KF8NH ha scritto: On 2009 Jan 14, at 9:02, Manlio Perillo wrote: This is of course a personal opinion, but I think the interface of: fileAccess :: FilePath - Bool - Bool - Bool - IO Bool http://haskell.org/ghc/docs/latest/html/libraries/unix/System-Posix-Files.html

Re: [Haskell-cafe] Re: some ideas for Haskell', from Python

2009-01-15 Thread Manlio Perillo
Gleb Alexeyev ha scritto: Manlio Perillo wrote: import System.Posix.Files as PF Try this: import qualified System.Posix.Files as PF The problem you described should go away. Ah, thanks! I really missed the qualified! Manlio Perillo

Re: [Haskell-cafe] real haskell difficulties (at least for me)

2009-01-15 Thread Manlio Perillo
in a 'incoming queue', and moved to the final destination only if it builds (and tests succeed) on all the supported platforms. [..] Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo

Re: [Haskell-cafe] real haskell difficulties (at least for me)

2009-01-15 Thread Manlio Perillo
software we have an Haskell name, with this name mapped to each specific package. However, this is not a solution for Windows since there's no native package manager. For windows an Haskell external package name can be mapped to an URL to a well know Windows installer. [...] Manlio

Re: [Haskell-cafe] real haskell difficulties (at least for me)

2009-01-15 Thread Manlio Perillo
. [...] Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] real haskell difficulties (at least for me)

2009-01-15 Thread Manlio Perillo
. And that we open ourselves up to some serious security concerns - like hostile build reports and DOS. DOS is always a problem, for every application open to the Internet. As for hostile builds reports, I don't see it as a security concern. -Yitz Manlio Perillo

Re: [Haskell-cafe] Haskell not ready for Foo [was: Re: Hypothetical Haskell job in New York]

2009-01-15 Thread Manlio Perillo
results can be accomplished by setting up a prepared statement that does SELECT function($1, ...). The Function Call cycle can then be replaced with Bind/Execute. P.S.: the PostgreSQL protocol is really well designed Regards Manlio Perillo

[Haskell-cafe] version information in the documentation

2009-01-15 Thread Manlio Perillo
think that this is an important information, and should be added. Thanks Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt

2009-01-15 Thread Manlio Perillo
. [...] Regards Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Issues with posix-realtime package

2009-01-14 Thread Manlio Perillo
Galchin, Vasili ha scritto: Hi Manlio, Are you now talking about code in Code from HsUnix.h and execvpe.h? Yes. Manlio ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] about System.Posix.Files.fileAccess

2009-01-14 Thread Manlio Perillo
? Thanks Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] walking a directory tree efficiently

2009-01-14 Thread Manlio Perillo
available in some package? Can you suggest better names? 3) I find (,) node `liftM` walkTree' path not very readable. Is it possible to express it in a more (not too much) verbose way? Thanks Manlio Perillo ___ Haskell-Cafe mailing list Haskell

[Haskell-cafe] some ideas for Haskell', from Python

2009-01-14 Thread Manlio Perillo
it is possible to import modules inside a function. In Haskell something like: joinPath' root name = joinPath [root, name] importing System.FilePath (joinPath) Thanks Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] some ideas for Haskell', from Python

2009-01-14 Thread Manlio Perillo
://unicode.org/cldr/ Thanks Neil Regards Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] real haskell difficulties (at least for me)

2009-01-14 Thread Manlio Perillo
to discover automatically which packages do and do not build on various platforms. The basics work but we need more help in polishing it up. Do you know buildbot? http://buildbot.net/trac Duncan Manlio Perillo ___ Haskell-Cafe mailing list

[Haskell-cafe] errno handling in concurrent haskell

2009-01-13 Thread Manlio Perillo
then do err - getErrno if err == eINTR then throwErrnoIfRetry pred loc f else throwErrno loc else return res This function calls getErrno two times. Is this safe? Why the throwErrno function does not accept errno as parameter? Thanks Manlio Perillo

[Haskell-cafe] Re: Issues with posix-realtime package

2009-01-13 Thread Manlio Perillo
? I'm on Linux Debian Lenny. Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: errno handling in concurrent haskell

2009-01-13 Thread Manlio Perillo
Simon Marlow ha scritto: Manlio Perillo wrote: I have some doubts about errno handling in a Concurrent Haskell program. Let's suppose that GHC non threaded runtime is used, so that each Haskell thread is bound to an OS thread. Let's suppose there are two threads running (`A` and `B

Re: [Haskell-cafe] Re: [Haskell] ANN: ghci-haskeline 0.1

2009-01-13 Thread Manlio Perillo
: http://msdn.microsoft.com/en-us/library/ms682087.aspx Regards Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] walking a directory tree efficiently

2009-01-13 Thread Manlio Perillo
Manlio perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] git mirrors for GHC boot libraries

2009-01-11 Thread Manlio Perillo
Hi. Where can I find git mirrors for GHC boot libraries? From http://hackage.haskell.org/trac/ghc/wiki/Design/VersionControlSystem it is not clear if the mirrors are already available. Thanks Manlio Perillo ___ Haskell-Cafe mailing list Haskell

<    1   2   3   >