Re: [Haskell-cafe] difficulty getting cabal and macports to play nice

2010-03-14 Thread Brandon S. Allbery KF8NH
On Mar 14, 2010, at 01:53 , Carter Schonwald wrote: sudo cabal install --extra-lib-dirs=/opt/local/lib --extra-include- dirs=/opt/local/include hieroglyph chart Resolving dependencies... cabal: cannot configure Hieroglyph-3.89. It requires cairo -any, glib -any, gtk =0.10.0 and gtkglext -any

Re: [Haskell-cafe] definition of sum

2010-03-14 Thread Yitzchak Gale
Daniel Fischer wrote: I'm not sure whether it's a wart or a bug, but I agree that it would be better to have the default sum strict David Leimbach wrote: That would be really inconsistent with the way the rest of the Haskell language and libraries works... I would propose that... sum be

Re: [Haskell-cafe] Data.Binary.GetT or ... ?

2010-03-14 Thread Juraj Hercek
On 03/13/2010 12:35 PM, Paul Johnson wrote: On 13/03/10 10:06, Juraj Hercek wrote: Hello, I'm thinking about using Data.Binary to parse binary stream of data. Binary data stream consists of messages which can have one or more (sometimes couple of hundreds) sub-messages. The stream is spitting

[Haskell-cafe] [Haskell.org Google Summer of Code] trac signup issues

2010-03-14 Thread Marc D. Migge
Hello, my name is Marc Migge. I would like to sign up as a student for this year's summer of code. Could you please add me to the Trac page using the email address marcmi...@gmx.net? Thank you. Best regards, Marc Migge signature.asc Description: OpenPGP digital signature

Re: [Haskell-cafe] difficulty getting cabal and macports to play nice

2010-03-14 Thread Carter Schonwald
hrm... I'm encounter a whole slew of problems getting gtk2hs to build now, might be snow leopard related glib/System/Glib.hs:13:0: Failed to load interface for `System.Glib.UTFString': Use -v to see a list of the files searched for. make: *** [glib/System/Glib.o] Error 1 is the

[Haskell-cafe] ANNOUNCE: Mac and Windows installers for Leksah 0.8 prerelease available

2010-03-14 Thread Hamish Mackenzie
We have uploaded first pass at Windows and OS X binaries for 0.8. They are both built using GHC 6.12.1. Installation: Make sure ghc 6.12.1 is installed. Take care that wget and grep are on your PATH. Please try them out if you can and let us know if you find any issues.

[Haskell-cafe] ANNOUNCE: Haddock 2.7.0

2010-03-14 Thread David Waern
-- Haddock 2.7.0 A new version of Haddock, the Haskell documentation tool, is out! -- Changes in version 2.7.0 *

[Haskell-cafe] Parsec to parse tree structures?

2010-03-14 Thread david fries
Hello Café Some time ago I wrote a parser for a project of one our customers. The format was proprietary and binary. The data was structured as a tree with tables pointing to sub tables farther in the file. (Well actually there was one or two cases where branches joined together, so I guess it

Re: [Haskell-cafe] Parsec to parse tree structures?

2010-03-14 Thread Stephen Tetley
On 14 March 2010 16:03, david fries d...@gmx.ch wrote: [SNIP] Oddly enough, our customer never bothered to write a parser of their own. I wonder why. Hi David If the binary structure was previously used only with C programs its quite common just to use casting to unpack the data into a struct

Re: [Haskell-cafe] Re: If wishes were horses...

2010-03-14 Thread Ben Millwood
On Sat, Mar 13, 2010 at 3:19 AM, wren ng thornton w...@freegeek.org wrote: The usual approach I've seen is not to distinguish strict and lazy datatypes, but rather to distinguish strict and lazy functions, e.g. by having two different arrows: (-) for lazy functions and (!-) for strict

[Haskell-cafe] gtk2hs gtkbuilder

2010-03-14 Thread Andrew U. Frank
i currently use gtk2hs with libglade (and glade). i understand that the gtkbuilder allows more constructs than libglade. how to use gtkbuilder in gtk2hs? i see that John Millikin has posted a patch for gtk2hs - but i cannot find it and no documentation for its use? can anyone point me to a

[Haskell-cafe] Multiple versions of a cabal package Or what's the right way to update?

2010-03-14 Thread david fries
Dear Caféistas I desperately need your collective knowledge I have been working on porting the haskell-platform to the FreeBSD operating system for a while now and some versioning issues have come up. FreeBSD is still running on GHC-6.10.4 (6.12 is in the works). The ghc package contains a

Re: [Haskell-cafe] Parsec to parse tree structures?

2010-03-14 Thread david fries
Hi Stephen Perhaps my description of the format was a bit unclear. When I said pointer I simply meant a number which is the position in the stream. Imagine the tables looking something like this: RootTable HeaderMagicNumber (1Byte): 0x50 VersionNumber (2 Bytes): 1234 SubTablePointer

Re: [Haskell-cafe] gtk2hs gtkbuilder

2010-03-14 Thread John Millikin
My patch was accepted into gtk2hs trunk. It should be present in the next release, or you can clone the in-development version with Darcs (see http://www.haskell.org/gtk2hs/development/ ). The Haskell module can be viewed at http://code.haskell.org/gtk2hs/gtk/Graphics/UI/Gtk/Builder.chs.pp ;

Re: [Haskell-cafe] ANNOUNCE: Haddock 2.7.0

2010-03-14 Thread Bas van Dijk
On Sun, Mar 14, 2010 at 3:49 PM, David Waern david.wa...@gmail.com wrote: ... -- Changes in version 2.7.0 ...  * Bug fixes (most importantly #128) ... Nice! Ross, can this be installed on hackage? Because the documentation of the base library is suffering from bug #128:

[Haskell-cafe] Re: gtk2hs gtkbuilder

2010-03-14 Thread Andy Stewart
Andrew U. Frank fr...@geoinfo.tuwien.ac.at writes: i currently use gtk2hs with libglade (and glade). i understand that the gtkbuilder allows more constructs than libglade. how to use gtkbuilder in gtk2hs? i see that John Millikin has posted a patch for gtk2hs - but i cannot find it and no

Re: [Haskell-cafe] Parsec to parse tree structures?

2010-03-14 Thread Stephen Tetley
Hi David Ah ha - this form of binary file layout is quite common (e.g. PECOFF object files and OpenType / TrueType fonts). Parsec and other parsing libraries are perhaps not ideal for the task, as they consume input as they parse. I have my own alternative to Parsec - Kangaroo [1] - for parsing

[Haskell-cafe] Splitting list with predicate

2010-03-14 Thread michael rice
Is there a library function that will create two lists from one based on a predicate, one list for all elements that satisfy the predicate and one for all that do not? Don't want to reinvent the wheel. Michael ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Splitting list with predicate

2010-03-14 Thread Stephen Tetley
Hi Michael Data.List.partition - from the docs... partition :: (a - Bool) - [a] - ([a], [a]) Source The partition function takes a predicate a list and returns the pair of lists of elements which do and do not satisfy the predicate, respectively; i.e., partition p xs == (filter p xs, filter

Re: [Haskell-cafe] Splitting list with predicate

2010-03-14 Thread Alexander Dunlap
On Sun, Mar 14, 2010 at 12:26 PM, michael rice nowg...@yahoo.com wrote: Is there a library function that will create two lists from one based on a predicate, one list for all elements that satisfy the predicate and one for all that do not? Don't want to reinvent the wheel. Michael

Re: [Haskell-cafe] Splitting list with predicate

2010-03-14 Thread michael rice
Most excellent! Thanks. Michael --- On Sun, 3/14/10, Stephen Tetley stephen.tet...@gmail.com wrote: From: Stephen Tetley stephen.tet...@gmail.com Subject: Re: [Haskell-cafe] Splitting list with predicate To: michael rice nowg...@yahoo.com Cc: haskell-cafe@haskell.org Date: Sunday, March 14,

Re: [Haskell-cafe] Splitting list with predicate

2010-03-14 Thread Simon Hengel
Most excellent! Thanks. I frequently use Hoogle[1] when I need a function, that I think must exist, but do not know how it is named. Try: (a - Bool) - [a] - ([a], [a]) With the recipe from [2] you may even invoke hoogle from within ghci: ghci :hoogle (a - Bool) - [a] - ([a], [a]) Hope that

Re: [Haskell-cafe] Parsec to parse tree structures?

2010-03-14 Thread david fries
Yep, That's what I had in mind. Thanks for the link. On Sun, 2010-03-14 at 19:09 +, Stephen Tetley wrote: Hi David Ah ha - this form of binary file layout is quite common (e.g. PECOFF object files and OpenType / TrueType fonts). Parsec and other parsing libraries are perhaps not ideal

Re: [Haskell-cafe] Splitting list with predicate

2010-03-14 Thread michael rice
Thanks all, Wouldn't one need to know the order of the arguments? (a - Bool) - [a] - ([a], [a]) Michael --- On Sun, 3/14/10, Simon Hengel simon.hen...@wiktory.org wrote: From: Simon Hengel simon.hen...@wiktory.org Subject: Re: [Haskell-cafe] Splitting list with predicate To: michael rice

Re: [Haskell-cafe] Splitting list with predicate

2010-03-14 Thread Daniel Fischer
Am Sonntag 14 März 2010 21:19:19 schrieb michael rice: Thanks all, Wouldn't one need to know the order of the arguments? (a - Bool) - [a] - ([a], [a]) hoogle also lists functions with similar types, so it probably also would find partition if you searched for a function of type [a] - (a -

Re: [Haskell-cafe] Splitting list with predicate

2010-03-14 Thread Simon Hengel
Wouldn't one need to know the order of the arguments? (a - Bool) - [a] - ([a], [a]) Not really, if you try [a] - (a - Bool) - ([a], [a]) it will yield the exact same list of results. Cheers. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] How to do the permutation and combination thing?

2010-03-14 Thread Richard O'Keefe
The first question is what does 'all the combinations' actually MEAN? We are told that f [a,b,c] [d,e,f] [g,h,i] = [[(a,d,g),(b,e,h),(c,f,i)], ...] in which the first element of the result is just zip3 [a,b,c] [d,e,f], [g,h,i]. But what are the other elements? Why is all

Re: [Haskell-cafe] difficulty getting cabal and macports to play nice

2010-03-14 Thread Carter Schonwald
so the solution turns out to be (for those who are macports users) to build of the macports stuff related gtk2 et al as the variants +universal (sadly parts of +quartz and +no_x11 seems to be slightly broken), to make sure that macports also has built gtksourceview2 (somehow trying to use

[Haskell-cafe] Re: First time haskell - parse error!

2010-03-14 Thread Achim Schneider
Sebastian Fischer s...@informatik.uni-kiel.de wrote: (Choosing names that are misleading or flat out wrong is of course always a bad idea.) foo = f . g . h where f x = ... g x = ... h x = ... Sometimes laziness is just the clearest option. -- (c) this sig last receiving data

[Haskell-cafe] #haskell-web, anyone ?

2010-03-14 Thread Simon Michael
We just had a big old web dev discussion in #darcs, which made me want to hang out in #haskell-web and hear more of the same. I think it existed briefly and died, but maybe it's time to try again ? Normally I don't like removing interesting chat from the main channel, but #haskell is often

[Haskell-cafe] how to user mergeIO

2010-03-14 Thread Brock Peabody
Hi, I've been trying to use Control.Concurrent.mergeIO to parallelize computation, and can't make it work. In the sample program below, I expect the function 'parallelTest' to be almost twice as fast as 'sequentialTest', and to compute its results in two threads, as implied by the documentation

Re: [Haskell-cafe] difficulty getting cabal and macports to play nice

2010-03-14 Thread Brandon S. Allbery KF8NH
On Mar 14, 2010, at 06:46 , Carter Schonwald wrote: hrm... I'm encounter a whole slew of problems getting gtk2hs to build now, might be snow leopard related glib/System/Glib.hs:13:0: Failed to load interface for `System.Glib.UTFString': Use -v to see a list of the files searched

Re: [Haskell-cafe] Splitting list with predicate

2010-03-14 Thread michael rice
Cool. Will keep that in mind next time I'm looking for an operation but don't know what it's called. Michael --- On Sun, 3/14/10, Simon Hengel simon.hen...@wiktory.org wrote: From: Simon Hengel simon.hen...@wiktory.org Subject: Re: [Haskell-cafe] Splitting list with predicate To: michael rice

[Haskell-cafe] Re: how to user mergeIO

2010-03-14 Thread Brock Peabody
OK, I think I figured it out. If I understand correctly, I was just computing the input lists in parallel. The actual values were computed in the main thread lazily, later. This seems unintuitive to me. Shouldn't the merge functions force the evaluation of their arguments? Surely one wouldn't be

Re: [Haskell-cafe] Re: how to user mergeIO

2010-03-14 Thread Scott Turner
The essence of mergeIO is to merge the _lists_ that are produced by independent threads. As far as Haskell is concerned, the elements in the list are another matter, as is the evaluation of those elements. So the merge functions force the evaluation of their arguments to a certain extent.

Re: [Haskell-cafe] #haskell-web, anyone ?

2010-03-14 Thread Michael Snoyman
On the same topic, some of us have started moving web discussions back over to web-devel mailing list. Looks like it's a fun time to be doing web development in Haskell :). Michael On Sun, Mar 14, 2010 at 2:13 PM, Simon Michael si...@joyful.com wrote: We just had a big old web dev discussion

[Haskell-cafe] Using regexps to filter data

2010-03-14 Thread michael rice
Not sure I'm even in the right neighborhood with this. Need to screen for integer data. Am I going about this correctly? Michael == [mich...@localhost ~]$ ghci GHCi, version 6.10.4: http://www.haskell.org/ghc/  :? for help Loading package ghc-prim ... linking ... done. Loading package

[Haskell-cafe] Re: If the local variable can be changed ...

2010-03-14 Thread Chung-chieh Shan
zaxis z_a...@163.com wrote in article 27844016.p...@talk.nabble.com in gmane.comp.lang.haskell.cafe: As we know, the local variable is allocated on stack which is thread safe. It's not. http://en.wikipedia.org/wiki/Funarg_problem#Example -- Edit this signature at