Re: Pickling a finite map (Binary + zlib) [was: [Haskell-cafe] Data.Binary poor read performance]

2009-02-24 Thread Don Stewart
dons: wren: Neil Mitchell wrote: 2) The storage for String seems to be raw strings, which is nice. Would I get a substantial speedup by moving to bytestrings instead of strings? If I hashed the strings and stored common ones in a hash table is it likely to be a big win? Bytestrings

Re: Pickling a finite map (Binary + zlib) [was: [Haskell-cafe] Data.Binary poor read performance]

2009-02-24 Thread Felipe Lessa
On Tue, Feb 24, 2009 at 4:59 AM, Don Stewart d...@galois.com wrote: Looks like the Map reading/showing via association lists could do with further work. Anyone want to dig around in the Map instance? (There's also some patches for an alternative lazy Map serialisation, if people are keen to

[Haskell-cafe] Re: package for algebraic structures

2009-02-24 Thread Aaron Denney
On 2009-02-19, Wolfgang Jeltsch g9ks1...@acme.softbase.org wrote: In addition, I wouldn’t include algebraic structures in a *numerical* prelude since the cool thing about them is that they are so abstract that they are not only about numbers. But the thing is that to have the numerical classes

RE: [Haskell-cafe] Looping after compiling with cabal

2009-02-24 Thread Simon Peyton-Jones
Try rm-ing *.o, *.hi. Simon | -Original Message- | From: Henk-Jan van Tuyl [mailto:hjgt...@chello.nl] | Sent: 23 February 2009 20:46 | To: Simon Peyton-Jones; Haskell cafe | Subject: Re: [Haskell-cafe] Looping after compiling with cabal | | | I tried to compile with head, but I got the

Re: Pickling a finite map (Binary + zlib) [was: [Haskell-cafe] Data.Binary poor read performance]

2009-02-24 Thread Don Stewart
felipe.lessa: On Tue, Feb 24, 2009 at 4:59 AM, Don Stewart d...@galois.com wrote: Looks like the Map reading/showing via association lists could do with further work. Anyone want to dig around in the Map instance? (There's also some patches for an alternative lazy Map serialisation,

Re: Pickling a finite map (Binary + zlib) [was: [Haskell-cafe] Data.Binary poor read performance]

2009-02-24 Thread Felipe Lessa
On Tue, Feb 24, 2009 at 5:36 AM, Don Stewart d...@galois.com wrote: This idea was the motivation for the new Seq instance, which uses internals to build quickly. The problem is that fromDistinctAscList is the best we can do right now. We don't have something like (|) that runs in O(1) time, and

[Haskell-cafe] Re: Pickling a finite map (Binary + zlib) [was: Data.Binary poor read performance]

2009-02-24 Thread Christian Maeder
Felipe Lessa wrote: The builds seem fine, but we spot a (length xs) on the beginning. Maybe this is the culprit? We already know the size of the map (it was serialized), so it is just a matter of exporting fromDistinctAscSizedList :: Int - [(k, a)] - Map k a Excellent idea, what does stop

Re[2]: Pickling a finite map (Binary + zlib) [was: [Haskell-cafe] Data.Binary poor read performance]

2009-02-24 Thread Bulat Ziganshin
Hello Felipe, Tuesday, February 24, 2009, 11:24:19 AM, you wrote: Too bad 'Map' is exported as an abstract data type and it's not straighforward to test this conjecture. Any ideas? just make a copy of its implementation to test btw, i always thought that it should be a way to overcome any

[Haskell-cafe] ANN: bug fix for regex-tdfa, version 0.97.4 (and regex-ast)

2009-02-24 Thread ChrisK
Hello, The regex-tdfa package has had a series of bug fix releases (0.97.1 and 2 and 3 and now 4). This 0.97.4 releases finishes fixing the bug that was only mostly fixed in the 0.97.1 release. An example of the fixed bug: Apply the regex pattern (BB(B?))+(B?) to the text . The BB

Re: Re[2]: Pickling a finite map (Binary + zlib) [was: [Haskell-cafe] Data.Binary poor read performance]

2009-02-24 Thread Svein Ove Aas
2009/2/24 Bulat Ziganshin bulat.zigans...@gmail.com: Hello Felipe, Tuesday, February 24, 2009, 11:24:19 AM, you wrote: Too bad 'Map' is exported as an abstract data type and it's not straighforward to test this conjecture. Any ideas? just make a copy of its implementation to test btw, i

Export restrictions :) Re[4]: Pickling a finite map (Binary + zlib) [was: [Haskell-cafe] Data.Binary poor read performance]

2009-02-24 Thread Bulat Ziganshin
Hello Svein, Tuesday, February 24, 2009, 3:47:44 PM, you wrote: btw, i always thought that it should be a way to overcome any export lists and go directly to module internals. limiting export is the way to protect programmer from errors, not security feature, and it should be left to

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

2009-02-24 Thread Belka
It's hard to belive, that nobody ever tackled/solved the subj. problem. I still can delay a bit solving it, in hope somebody would share experience. Regards, Belka Belka wrote: Hello, communion people! I have a problem and ask for an advice. I'm dealing with sockets on *Linux*

Re: Re[2]: Pickling a finite map (Binary + zlib) [was: [Haskell-cafe]Data.Binary poor read performance]

2009-02-24 Thread Claus Reinke
btw, i always thought that it should be a way to overcome any export lists and go directly to module internals. limiting export is the way to protect programmer from errors, not security feature, and it should be left to programmer to decide when he don't need it. compilers should just be able to

[Haskell-cafe] Help with Bird problem 3.3.3

2009-02-24 Thread Peter Hilal
I'm working my way through Bird's _Introduction to Functional Programming Using Haskell_. I'd appreciate any help with problem 3.3.3, which is: Division of natural numbers can be specified by the condition (n * m) / n = m for all positive n and all m. Construct a program for division

[Haskell-cafe] Cabal: local documentation

2009-02-24 Thread Martijn van Steenbergen
Hello, Can cabal automatically generate local documentation for packages I install? It'd be awesome if it generated a page like [1] for locally installed packages. Thanks, Martijn. [1] http://www.haskell.org/ghc/dist/current/docs/libraries/ ___

Re: [Haskell-cafe] Cabal: local documentation

2009-02-24 Thread Felipe Lessa
Just pass '--enable-documentation' to 'cabal install'. On *nix they're generated at ~/.cabal/share/doc. HTH, -- Felipe. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Hac5 projects page

2009-02-24 Thread Wolfgang Jeltsch
Hello, on http://www.haskell.org/haskellwiki/Hac5/Projects, you can list a project under “Project descriptions” and under “Experiences”. What’s the difference? Best wishes, Wolfgang ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

RE: [Haskell-cafe] Hac5 projects page

2009-02-24 Thread Sittampalam, Ganesh
Wolfgang Jeltsch wrote: on http://www.haskell.org/haskellwiki/Hac5/Projects, you can list a project under Project descriptions and under Experiences. What's the difference? A project description is something you plan to work on, and an experience is something you could help other people

Re: [Haskell-cafe] Hac5 projects page

2009-02-24 Thread Andres Loeh
on http://www.haskell.org/haskellwiki/Hac5/Projects, you can list a project under “Project descriptions” and under “Experiences”. What’s the difference? Project descriptions are supposed to be projects you're currently working on or want to work on during the Hackathon. Experiences are not

Re: [Haskell-cafe] Re: package for algebraic structures

2009-02-24 Thread Wolfgang Jeltsch
Am Dienstag, 24. Februar 2009 09:30 schrieb Aaron Denney: On 2009-02-19, Wolfgang Jeltsch g9ks1...@acme.softbase.org wrote: In addition, I wouldn’t include algebraic structures in a *numerical* prelude since the cool thing about them is that they are so abstract that they are not only about

Re: [Haskell-cafe] Cabal: local documentation

2009-02-24 Thread Svein Ove Aas
2009/2/24 Felipe Lessa felipe.le...@gmail.com: Just pass '--enable-documentation' to 'cabal install'. On *nix they're generated at ~/.cabal/share/doc. Or edit ~/.cabal/config and set the documentation key to True ___ Haskell-Cafe mailing list

Re: Pickling a finite map (Binary + zlib) [was: [Haskell-cafe] Data.Binary poor read performance]

2009-02-24 Thread Bertram Felgenhauer
Don Stewart wrote: dons: [...] Just serialising straight lists of pairs, [...] And reading them back in, main = do [f] - getArgs m - decode `fmap` L.readFile f print (length (m :: [(B.ByteString,Int)])) print done Well, you don't actually read the

[Haskell-cafe] Help with another Bird problem (3.3.4)

2009-02-24 Thread Peter Hilal
Could someone provide a solution to do the following problem from Bird: The function log can be specified by the condition that log (2^m) = m for all m. Construct a program for log and prove that it meets the specification. Note that this problem doesn't specify a domain, unlike problem

Re: Pickling a finite map (Binary + zlib) [was: [Haskell-cafe] Data.Binary poor read performance]

2009-02-24 Thread Paulo Tanimoto
Hello, On Tue, Feb 24, 2009 at 2:36 AM, Don Stewart d...@galois.com wrote: This idea was the motivation for the new Seq instance, which uses internals to build quickly.    Encoding to disk, the dictionary,        $ time ./binary /usr/share/dict/cracklib-small        done        ./binary

Re: Pickling a finite map (Binary + zlib) [was: [Haskell-cafe] Data.Binary poor read performance]

2009-02-24 Thread Bertram Felgenhauer
Felipe Lessa wrote: On Tue, Feb 24, 2009 at 4:59 AM, Don Stewart d...@galois.com wrote: Looks like the Map reading/showing via association lists could do with further work. Anyone want to dig around in the Map instance? (There's also some patches for an alternative lazy Map

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

2009-02-24 Thread Manlio Perillo
Belka ha scritto: Hello, communion people! I have a problem and ask for an advice. I'm dealing with sockets on *Linux* platform (Network.Socket). The problem is that I can't fully control timeout for (connect :: Socket - SockAddr - IO ()) operation. On my system the timeout is - 3 seconds -

[Haskell-cafe] MPTC inheritance

2009-02-24 Thread Derek Gladding
Please forgive me if I'm still mentally contaminated by the OO way of seeing (and discussing) the universe, but I'm trying to figure out how to inherit an interface from a multi-parameter type class. I have a Graph class that's parameterisable by Node and Edge type: class (Node a, Edge b) =

[Haskell-cafe] ONeillPrimes.hs - priority queue broken?

2009-02-24 Thread Eugene Kirpichov
Hi, I've recently tried to use the priority queue from the ONeillPrimes.hs, which is famous for being a very fast prime generator: actually, I translated the code to Scheme and dropped the values, to end up with a key-only heap implementation. However, the code didn't work quite well, and I

[Haskell-cafe] Re: Pickling a finite map (Binary + zlib) [was: Data.Binary poor read performance]

2009-02-24 Thread Christian Maeder
fromDistinctAscList :: [(k,a)] - Map k a fromDistinctAscList xs = build const (length xs) xs where -- 1) use continutations so that we use heap space instead of stack space. -- 2) special case for n==5 to build bushier trees. build c 0 xs' = c Tip xs' build c 5 xs'

Re: [Haskell-cafe] MPTC inheritance

2009-02-24 Thread Lennart Augustsson
There's nothing wrong with the definition of FooGraph. That's how you do it. -- Lennart On Tue, Feb 24, 2009 at 6:09 PM, Derek Gladding de...@solidmath.com wrote: Please forgive me if I'm still mentally contaminated by the OO way of seeing (and discussing) the universe, but I'm trying to

Re: [Haskell-cafe] MPTC inheritance - was operator error

2009-02-24 Thread Derek Gladding
Thanks to the kind replies I got off-list, I figured out that this was actually operator error on my part. class (Node a, Edge b) = Graph a b was actually class (Node a, Edge b) = Graph g a b but this was in code I'd written quite some time ago and I've written a lot of day-job C++ in the

Re: [Haskell-cafe] MPTC inheritance

2009-02-24 Thread Paul Johnson
Derek Gladding wrote: Please forgive me if I'm still mentally contaminated by the OO way of seeing (and discussing) the universe, but I'm trying to figure out how to inherit an interface from a multi-parameter type class. [...] but this isn't allowed (kind mismatch). Kinds are a meta-type

[Haskell-cafe] New version of Hieroglyph released: Hieroglyph 1.1 is on hackage

2009-02-24 Thread Jeff Heard
For those of you who don't read Reddit: Changes are minor right now. The main thing is that I'm now using Russell O'Connor's excellent Data.Colour library. The only other changes were to make H. compile with Gtk2Hs 0.10.x and to make it a bit easier to integrate Gtk2Hs guis with Hieroglyph and

Re: [Haskell-cafe] Hoogle and Network.Socket

2009-02-24 Thread Brandon S. Allbery KF8NH
On 2009 Feb 21, at 20:47, Jonathan Cast wrote: On Sat, 2009-02-21 at 07:25 -0700, John A. De Goes wrote: Not showing platform-specific packages by default *might* make package writers more likely to develop cross-platform packages. We've heard many times someone say, I don't know if it works

Re: [Haskell-cafe] The community is more important than the product

2009-02-24 Thread Brandon S. Allbery KF8NH
On 2009 Feb 21, at 18:59, Don Stewart wrote: http://haskell.org/haskellwiki/Protect_the_community Random notes on how to maintain tone, focus and productivity in an online community I took a few years ago. http://shirky.com/writings/group_enemy.html A group is its own worst enemy --

Re: [Haskell-cafe] Haskellers on Twitter!

2009-02-24 Thread Brandon S. Allbery KF8NH
On 2009 Feb 23, at 11:26, Andrew Wagner wrote: Modified. Is this how you want it to show? That works, yes. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu electrical and computer engineering,

Re: [Haskell-cafe] Help with another Bird problem (3.3.4)

2009-02-24 Thread Luke Palmer
On Tue, Feb 24, 2009 at 9:53 AM, Peter Hilal pe...@hilalcapital.com wrote: Could someone provide a solution to do the following problem from Bird: The function log can be specified by the condition that log (2^m) = m for all m. Construct a program for log and prove that it meets the

Re: [Haskell-cafe] Data.Binary poor read performance

2009-02-24 Thread jutaro
wren ng thornton wrote: If you have many identical strings then you will save lots by memoizing your strings into Integers, and then serializing that memo table and the integerized version of your data structure. The amount of savings decreases as the number of duplications decrease,

Re: [Haskell-cafe] ONeillPrimes.hs - priority queue broken?

2009-02-24 Thread Daniel Fischer
Am Dienstag, 24. Februar 2009 19:16 schrieb Eugene Kirpichov: Hi, I've recently tried to use the priority queue from the ONeillPrimes.hs, which is famous for being a very fast prime generator: actually, I translated the code to Scheme and dropped the values, to end up with a key-only heap

Re: [Haskell-cafe] Help with Bird problem 3.3.3

2009-02-24 Thread Philip Armstrong
On Tue, Feb 24, 2009 at 10:25:56AM -0500, Peter Hilal wrote: Where do I go from here? Thank you so much. A hint: I don't think you can do it by recursion on (/). You'll need an auxiliary function. Then prove that your function satisfies the constraint. Phil (Unless there's some clever way to

Re: [Haskell-cafe] Data.Binary poor read performance

2009-02-24 Thread Don Stewart
jnf: wren ng thornton wrote: If you have many identical strings then you will save lots by memoizing your strings into Integers, and then serializing that memo table and the integerized version of your data structure. The amount of savings decreases as the number of duplications

[Haskell-cafe] emacs cedet support for haskell?

2009-02-24 Thread Xiao-Yong Jin
Hi, I've googled around for possible haskell support in emacs cedet, but couldn't find any. From cedet's website, it claims to support the following Language Parsers Parsers that have already been implemented: Emacs Lisp, Java, C/C++, C#, Python, Erlang, awk, Makefile, Scheme, HTML,

Re: [Haskell-cafe] Data.Binary poor read performance

2009-02-24 Thread Felipe Lessa
On Tue, Feb 24, 2009 at 7:42 PM, jutaro j...@arcor.de wrote: instance Eq Object where    (ObjC a) ≡ (ObjC b) = if typeOf a ≠ typeOf b                                then False                                else (Just a) ≡ cast b -- can someone explain to me why this works? In fact, can't

Re: [Haskell-cafe] Cabal: local documentation

2009-02-24 Thread Duncan Coutts
On Tue, 2009-02-24 at 17:42 +0100, Svein Ove Aas wrote: 2009/2/24 Felipe Lessa felipe.le...@gmail.com: Just pass '--enable-documentation' to 'cabal install'. On *nix they're generated at ~/.cabal/share/doc. Or edit ~/.cabal/config and set the documentation key to True However this does

Re: [Haskell-cafe] IntMap documentation error

2009-02-24 Thread Duncan Coutts
On Mon, 2009-02-23 at 17:22 -0600, Louis Wasserman wrote: In the documentation for Data.IntMap updateMin, a piece of example code both communicates incorrect intuition, and fails to even compile. updateMin :: (a - a) - IntMap a - IntMap a updateMin (\ _ - Nothing) (fromList [(5,a),

Re: [Haskell-cafe] Help with Bird problem 3.3.3

2009-02-24 Thread Ryan Ingram
Try starting with (m * n) / m = n -- given m /= 0 Then do case analysis on n. I found this process quite enlightening, thanks for posting. -- ryan 2009/2/24 Peter Hilal pe...@hilalcapital.com: I'm working my way through Bird's _Introduction to Functional Programming Using Haskell_. I'd

Re: [Haskell-cafe] ONeillPrimes.hs - priority queue broken?

2009-02-24 Thread Bertram Felgenhauer
Eugene Kirpichov wrote: Hi, I've recently tried to use the priority queue from the ONeillPrimes.hs, which is famous for being a very fast prime generator: actually, I translated the code to Scheme and dropped the values, to end up with a key-only heap implementation. However, the code didn't

[Haskell-cafe] Indentation Question.

2009-02-24 Thread Ramaswamy, Vivek
Hello All~ I have been reading the book Haskell for real programmers and am presently on chapter 03. There was a small program demonstrated by the author on let. The problem is that when I cut and paste authors code into eclipse, the program works fine, where as when I write my own copy of the

[Haskell-cafe] Re: Indentation Question.

2009-02-24 Thread mail
Ramaswamy, Vivek vivek.ramasw...@fmr.com writes: Hello All~ I have been reading the book ?Haskell for real programmers? and am presently on chapter 03. There was a small program demonstrated by the author on ?let?. The problem is that when I cut and paste authors code into eclipse, the

[Haskell-cafe] MapReduce reverse engineered

2009-02-24 Thread Galchin, Vasili
Hello, Here is an interesting paper of Google's MapReduce reverse engineered into Haskell. I apologize if already posted . http://www.cs.vu.nl/~ralf/MapReduce/ Kind regards, Vasili ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] ONeillPrimes.hs - priority queue broken?

2009-02-24 Thread Bertram Felgenhauer
Eugene Kirpichov wrote: module PQ where import Test.QuickCheck data PriorityQ k v = Lf | Br {-# UNPACK #-} !k v !(PriorityQ k v) !(PriorityQ k v) deriving (Eq, Ord, Read, Show) For the record, we can exploit the invariant that the sizes of the left and

[Haskell-cafe] Re: The community is more important than the product

2009-02-24 Thread Benjamin L . Russell
On Sat, 21 Feb 2009 15:59:54 -0800, Don Stewart d...@galois.com wrote: http://haskell.org/haskellwiki/Protect_the_community Random notes on how to maintain tone, focus and productivity in an online community I took a few years ago. Might be some material there if anyone's seeking to help ensure