[Haskell-cafe] Alternative to Data.Binary

2009-03-14 Thread Grzegorz Chrupala
Hi all, Is there a serialization library other than the Data.Binary from hackage? I am using Data.Binary in a couple of projects, but I have found its stack and memory usage very hard to control. Its very common that decoding a map or list of non-trivial size uses up all available RAM, or causes

Re: [Haskell-cafe] Alternative to Data.Binary

2009-03-14 Thread Grzegorz Chrupala
Don Stewart-2 wrote: Have you tried the latest release, which modified the Map and [a] instances? No, I'm working with 0.5. I'll give the new version a try. Thanks! -- Grzegorz -- View this message in context: http://www.nabble.com/Alternative-to-Data.Binary-tp22512229p22514771.html

[Haskell-cafe] Sparse vector operations

2009-02-27 Thread Grzegorz Chrupala
Hi all, In a couple of my projects I have needed to perform operations on (very) sparse vectors. I came up with the attached simple module which defines a typeclass and implements instances for simple and nested (Int)Maps. Is this the right way to go about it? Am I reinventing some wheels?

[Haskell-cafe] Installing GHC with libedit in nonstandard location

2009-01-24 Thread Grzegorz Chrupala
Hi all, I'm trying to install the GHC binary for Linux. The problem is my libedit is in $HOME/lib instead of /usr/lib So GHC installs but when I try to run it is fails with: error while loading shared libraries: libedit.so.0: cannot open shared object file: No such file ordirectory I tried

Re: [Haskell-cafe] Installing GHC with libedit in nonstandard location

2009-01-24 Thread Grzegorz Chrupala
greenrd wrote: The variable you need to set is LD_LIBRARY_PATH Indeed, this worked. Thanks! -- Grzegorz -- View this message in context: http://www.nabble.com/Installing-GHC-with-libedit-in-nonstandard-location-tp21641668p21643675.html Sent from the Haskell - Haskell-Cafe mailing list

[Haskell-cafe] Strange space leak

2008-07-14 Thread Grzegorz Chrupala
Hi all, I just noticed that a tiny change to the program which I posted recently in the More idiomatic use of strictness thread causes a space leak. The code is: {-# LANGUAGE BangPatterns, PatternGuards #-} import Data.List (foldl') import Data.Char split delim s | [] - rest = [token]

Re: [Haskell-cafe] Strange space leak

2008-07-14 Thread Grzegorz Chrupala
apfelmus wrote: Answer: split DOC . words . map toLower = (:[]) . words . map toLower Since you converted everything to lowercase, the string DOC will never appear in the text, resulting in a single huge document. Oops, that should have been obvious, sorry for the dumb

Re: [Haskell-cafe] More idiomatic use of strictness

2008-07-11 Thread Grzegorz Chrupala
Don Stewart-2 wrote: I'd use a strict pair and the rnf strategy. data P = P [Something] !Int rnf dfs' (P dfs' (n+1) Thanks all, it definitely seems like an improvement. -- Grzegorz -- View this message in context:

[Haskell-cafe] More idiomatic use of strictness

2008-07-10 Thread Grzegorz Chrupala
Hi all, Is there a less ugly way of avoiding laziness in the code pasted below then the use of seq in the last line? The program is supposed to split a large input file into chunks and check in how many of those chunks each of a list of words appear, as well as the total number of chunks.

Re: [Haskell-cafe] Stack overflow

2008-02-27 Thread Grzegorz Chrupala
Philip Armstrong wrote: On Sun, Feb 17, 2008 at 11:45:26PM +, Adrian Hey wrote: But I guess this rant is not much help to the OP :-) Can the Get Monad from Data.Binary be replaced by the one in Data.Binary.Strict.Get? Would probably require some hacking on the library I guess.

Re: [Haskell-cafe] Stack overflow

2008-02-27 Thread Grzegorz Chrupala
Bryan O'Sullivan wrote: On Feb 27, 2008, at 3:02 AM, Grzegorz Chrupala wrote: I was getting stack overflows when using Data.Binary with a few other datastructures so I decided to try this option. I hacked a Data.Binary.Strict module which is basically a copy and paste of Data.Binary

Re: [Haskell-cafe] Stack overflow

2008-02-18 Thread Grzegorz Chrupala
Philip Armstrong wrote: On Sun, Feb 17, 2008 at 10:01:14PM +, Adrian Hey wrote: Philip Armstrong wrote: Since no-one else has answered, I'll take a stab. Obiously, you have a stack leak due to laziness somewhere I wouldn't say that was obvious, though it is certainly a possibility.

[Haskell-cafe] Stack overflow

2008-02-14 Thread Grzegorz Chrupala
Hi all, I have a very simple program which reads a Data.Map from a file using Data.Binary and Data.ByteString.Lazy, which gives stack overflow with files over a certain size. Any ideas of what might be causing it? You can try it with the small file (11M) at:

Re: [Haskell-cafe] Parsing unstructured data

2007-11-28 Thread Grzegorz Chrupala
Olivier Boudry wrote: Hi all, This e-mail may be a bit off topic. My question is more about methods and algorithms than Haskell. I'm looking for links to methods or tools for parsing unstructured data. I'm currently working on data cleaning of a Customer Addresses database. Addresses

RE: [Haskell-cafe] Dynamically find out instances of classes (pluginsystem for haskell)

2007-11-22 Thread Grzegorz Chrupala
Bayley, Alistair-2 wrote: There are two libs that I'm aware of. http://hackage.haskell.org/cgi-bin/hackage-scripts/package/plugins-1.0 http://hackage.haskell.org/cgi-bin/hackage-scripts/package/metaplug-0.1. 1 There is also