Re: [Haskell-cafe] Collection of sets containing no sets which are a subset of another in the collection

2009-11-14 Thread Max Rabkin
On Sat, Nov 14, 2009 at 9:21 AM, Mark Wassell mwass...@bigpond.net.au wrote: Hi, I am looking for a data structure that will represent a collection of sets such that no element in the collection is a subset of another set. In other words, inserting an element that is already a subset of

[Haskell-cafe] Lexical Syntax and Unicode

2009-11-14 Thread Manlio Perillo
Hi. Reading the Haskell 98 Report (section 9.2), I have found a possible problem. The lexical syntax supports Unicode, however this is not true for the newline: newline - return linefeed | return | linefeed | formfeed The Unicode standard adds two additional characters: U+2028 LINE SEPARATOR

Re: [Haskell-cafe] Opinion about JHC

2009-11-14 Thread Henning Thielemann
On Fri, 13 Nov 2009, John Meacham wrote: On Fri, Nov 13, 2009 at 08:55:51PM +, Lennart Augustsson wrote: That was indeed my point. Since a compiler is a substantial program I would have more confidence it a compiler that is self-hosting. Surely you must have tried? No, there are

[Haskell-cafe] Some thoughts about Hackage

2009-11-14 Thread Vasyl Pasternak
Hi, Yesterday Max complained about documentation for many Haskell modules. But I found another similar problem with Hackage. Before coding some Haskell program I try to find most appropriate libraries, which help me to do task more efficiently. But the problem, that there are to many libraries

Re: [Haskell-cafe] haskell-src-exts Question

2009-11-14 Thread Neil Mitchell
Hi Adding brackets that MUST have been there, by default, sounds like a great idea. The alternative is getting it wrong, so I think that's very safe. Adding brackets that MIGHT have been there is a lot less clear cut. One important consideration is that the fixities you parse/pretty-print with

Re: [Haskell-cafe] Some thoughts about Hackage

2009-11-14 Thread Andrew Coppin
Vasyl Pasternak wrote: Before coding some Haskell program I try to find most appropriate libraries, which help me to do task more efficiently. But the problem, that there are to many libraries with similar functionality (for example - networking, web servers etc.). And to find the best solution

Re: [Haskell-cafe] Re: Writing great documentation[MESSAGE NOT SCANNED]

2009-11-14 Thread John O'Donnell
I agree with Duncan's comment: I rather like the idea of using markdown (pandoc) for separate non-reference docs like man pages, tutorials, user guides etc rather than trying to make haddock do everything. In one of my projects (Hydra and Sigma), I use pandoc for the bulk of the

Re: [Haskell-cafe] Some thoughts about Hackage

2009-11-14 Thread Felipe Lessa
On Sat, Nov 14, 2009 at 11:32:33AM +, Andrew Coppin wrote: Adding a ranking is nice, but a comment lets people add highly relevant information like this package is good, but doesn't work properly with Unicode and so forth. Stuff somebody about to try using the package would *really* want

Re: [Haskell-cafe] Some thoughts about Hackage

2009-11-14 Thread Stephen Tetley
2009/11/14 Felipe Lessa felipe.le...@gmail.com: Probably adding markers to the comment area every time a new version is added is also a nice idea because a problem in the comment are may be corrected.  The marker would serve as a visual aid that the comment may be outdated. It would be nice

Re: [Haskell-cafe] Some thoughts about Hackage

2009-11-14 Thread Gwern Branwen
On Sat, Nov 14, 2009 at 7:21 AM, Stephen Tetley stephen.tet...@gmail.com wrote: 2009/11/14 Felipe Lessa felipe.le...@gmail.com: Probably adding markers to the comment area every time a new version is added is also a nice idea because a problem in the comment are may be corrected.  The marker

Re: [Haskell-cafe] Collection of sets containing no sets which are a subset of another in the collection

2009-11-14 Thread Gwern Branwen
On Sat, Nov 14, 2009 at 4:35 AM, Max Rabkin max.rab...@gmail.com wrote: On Sat, Nov 14, 2009 at 9:21 AM, Mark Wassell mwass...@bigpond.net.au wrote: Hi, I am looking for a data structure that will represent a collection of sets such that no element in the collection is a subset of another

Re: [Haskell-cafe] haskell-src-exts Question

2009-11-14 Thread Daniel Schüssler
Hi, On Friday 13 November 2009 21:08:42 Neil Mitchell wrote: In HLint I have a bracketing module, which has served me well. Please take any ideas you need from it - http://community.haskell.org/~ndm/darcs/hlint/src/HSE/Bracket.hs . In particular, given a fully bracketed expression, I can call

[Haskell-cafe] How much time until dependencies are rebuilt in hackage?

2009-11-14 Thread Maurí­cio CA
Suppose package B depends on A. If a new version of A is uploaded to hackage, how much later package B will be rebuilt (either to show a problem with the new version or to solve a problem with a previous version of A)? Thanks, Maurício ___

Re: [Haskell-cafe] What does the `forall` mean ?

2009-11-14 Thread Mark Lentczner
On Nov 12, 2009, at 2:59 PM, Sean Leather wrote: foo :: forall x y. (x - x) - y bar :: forall y. (forall x . x - x) - y While neither function is seemingly useful, the second says that the higher-order argument must be polymorphic. I see two options: AHA! This is the bit of insight I

Re: [Haskell-cafe] haskell-src-exts Question

2009-11-14 Thread Neil Mitchell
Hi Daniel, Funny, I did the opposite approach the other day (not saying either is better :)); that is: parenthesize everything while building the AST (with a wrapper for App) and then: I have utilities in HLint for that too - but I don't want to remove users brackets automatically :-) Btw,

[Haskell-cafe] Where is a good place to place code like this, so if I may be so bold, people can learn from it?

2009-11-14 Thread Casey Hawthorne
Where is a good place to place code like this, so if I may be so bold, people can learn from it? {- Author Modifications:Casey Hawthorne Author Original: Jeff Newbern Maintainer: Casey Hawthorne cas...@istar.ca Maintainer?: Jeff Newbern jnewb...@nomaware.com

[Haskell-cafe] Some help needed to start Haskell with Yi

2009-11-14 Thread Jaco van Iterson
Hi there I'm new to Haskell and need some help to get started faster (busy busy busy). I like to adjust and extend an editor to my liking and I choose Yi. Only installation with 'cabal install yi' in a Cygwin shell under MS Windows XP ended in: Yi\Prelude.hs:182:9: Duplicate instance

Re: [Haskell-cafe] Where is a good place to place code like this, so if I may be so bold, people can learn from it?

2009-11-14 Thread Bulat Ziganshin
Hello Casey, Saturday, November 14, 2009, 9:15:51 PM, you wrote: Where is a good place to place code like this, so if I may be so bold, people can learn from it? the solution i've seen in 80's was: main = print (solutions 8 8) solutions n 0 = [[]] solutions n k = [(i,k):xs | xs - solutions

Re: [Haskell-cafe] Where is a good place to place code like this, so if I may be so bold, people can learn from it?

2009-11-14 Thread Casey Hawthorne
Hi Bulat: I believe Jeff's original idea was to show an example of a monad transformer stack and ASCII art output. On Sat, 14 Nov 2009 21:42:01 +0300, you wrote: Hello Casey, Saturday, November 14, 2009, 9:15:51 PM, you wrote: Where is a good place to place code like this, so if I may be so

Re: [Haskell-cafe] Type-indexed expressions with fixpoint

2009-11-14 Thread pbrowne
o...@okmij.org wrote: Brent Yorgey wrote: John Reynolds showed long ago that any higher-order language can be encoded in first-order. We witness this every day: higher-order language like Haskell is encoded in first-order language (machine code). The trick is just to add a layer of

Re: [Haskell-cafe] Collection of sets containing no sets which are a subset of another in the collection

2009-11-14 Thread Felipe Lessa
On Sat, Nov 14, 2009 at 09:13:48AM -0500, Gwern Branwen wrote: http://hackage.haskell.org/package/union-find ? This one is ephemeral, not persistant. -- Felipe. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] How much time until dependencies are rebuilt in hackage?

2009-11-14 Thread Felipe Lessa
On Sat, Nov 14, 2009 at 01:47:04PM -0200, Maurí­cio CA wrote: Suppose package B depends on A. If a new version of A is uploaded to hackage, how much later package B will be rebuilt (either to show a problem with the new version or to solve a problem with a previous version of A)? I would

Re: [Haskell-cafe] ANN: hesql

2009-11-14 Thread Jake Wheat
Hello Christoph, I've been working on a SQL parser (http://hackage.haskell.org/package/hssqlppp) which might be useful for your project, although it might be a bit heavy weight (its feature scope getting more and more out of control...). Adding support for parsing ? placeholder statements is on

Re: [Haskell-cafe] Where is a good place to place code like this, so if I may be so bold, people can learn from it?

2009-11-14 Thread Gwern Branwen
On Sat, Nov 14, 2009 at 1:15 PM, Casey Hawthorne cas...@istar.ca wrote: Where is a good place to place code like this, so if I may be so bold, people can learn from it? The Haskell wiki, I would suggest. If it were shorter and less Haskell-specific, then maybe also Rosetta Code

Re: [Haskell-cafe] Type-indexed expressions with fixpoint

2009-11-14 Thread Pierre-Evariste Dagand
Do you have the reference for Reynolds higher-order to first-order encoding. The reference discussed here is very likely to be: Definitional Interpreters for Higher-Order Programming Languages http://www.brics.dk/~hosc/local/HOSC-11-4-pp363-397.pdf You might also be interested in:

[Haskell-cafe] Little errors in number calculations

2009-11-14 Thread Abby Henríquez Tejera
Hi. I've seen that in GHC sometimes there are little errors in some basic number calculations: *Prelude 123.35503 * 10.0 1233.55029 *Prelude properFraction 123.35503 (123,0.35502993) whereas in Hugs no such errors seem to occur (that I have found, at least): *Hugs 123.35503 *

Re: [Haskell-cafe] Little errors in number calculations

2009-11-14 Thread Bulat Ziganshin
Hello Abby, Sunday, November 15, 2009, 12:00:42 AM, you wrote: I understand that error may (and will) happen in floating point, but it surprises me that they do so easily, and, above all, the difference between GHC and Hugs. Does someone know why does this difference occur? compare:

Re: [Haskell-cafe] Little errors in number calculations

2009-11-14 Thread Ross Paterson
On Sat, Nov 14, 2009 at 09:00:42PM +, Abby Henríquez Tejera wrote: I understand that error may (and will) happen in floating point, but it surprises me that they do so easily, and, above all, the difference between GHC and Hugs. Does someone know why does this difference occur? The

Re: [Haskell-cafe] Little errors in number calculations

2009-11-14 Thread Erik de Castro Lopo
Abby Henríquez Tejera wrote: I understand that error may (and will) happen in floating point, Yes, explained here: http://docs.sun.com/source/806-3568/ncg_goldberg.html but it surprises me that they do so easily, and, above all, the difference between GHC and Hugs. Does someone know

[Haskell-cafe] attoparsec and parsec

2009-11-14 Thread Manlio Perillo
Hi. I'm writing a generic log parsing package, and I'm serching a parser combinators library. Parsing log files is a simple task, so I would like to use the more efficient solution. I have looked at attoparsec source code, and it seems very specialized for lazy bytestrings parsing, so I assume

Re: [Haskell-cafe] What does the `forall` mean ?

2009-11-14 Thread Lennart Augustsson
Of the two declarations data Fizzle a = Fizzle (b - (a, b)) a data Fizzle a = forall b. Fizzle (b - (a, b)) a only the second one is allowed (with some suitable extension). Personally I think the first one should be allowed as well, with the same meaning as the second one. Some

Re: [Haskell-cafe] attoparsec and parsec

2009-11-14 Thread Jason Dusek
To add to the confusion, I forked `bytestringparser` when I wrote the `json-b` package. The fork is here: http://hackage.haskell.org/package/bytestringparser-temporary/ I have added a number of things to original as well as fixing some problems with it. The reason I went with the

Re: [Haskell-cafe] Some help needed to start Haskell with Yi

2009-11-14 Thread Kapil Hari Paranjape
Hello, On Sat, 14 Nov 2009, Jaco van Iterson wrote: Only installation with 'cabal install yi' in a Cygwin shell under MS Windows XP ended in: Yi\Prelude.hs:182:9: Duplicate instance declarations: instance Category Accessor.T -- Defined at Yi\Prelude.hs:182:9-38 instance

Re: [Haskell-cafe] What does the `forall` mean ?

2009-11-14 Thread Felipe Lessa
On Sun, Nov 15, 2009 at 01:14:34AM +, Lennart Augustsson wrote: Of the two declarations data Fizzle a = Fizzle (b - (a, b)) a data Fizzle a = forall b. Fizzle (b - (a, b)) a only the second one is allowed (with some suitable extension). Personally I think the first one

[Haskell-cafe] help with musical data structures

2009-11-14 Thread Michael Mossey
I'm pretty new to Haskell so I don't know what kind of data structure I should use for the following problem. Some kind of arrays, I guess. One data item, called OrientedPCSet (oriented pitch class set, a musical term) will represent a set whose members are from the range of integers 0 to 11.

Re: [Haskell-cafe] Could someone teach me why we use Data.Monoid?

2009-11-14 Thread Daniel Schüssler
Hi, - Product (a,b) and co-product (Either) of monoids the coproduct of monoids is actually a bit tricky. It could be implemented like this: -- | -- Invariant 1: There are never two adjacent Lefts or two adjacent Rights -- Invariant 2: No elements (Left mempty) or (Right mempty) allowed

[Haskell-cafe] Why can `env` be assigned value two times ?

2009-11-14 Thread zaxis
defineVar :: Env - (Id, Val) - IOThrowsError Val defineVar envRef (id, val) = do { env - liftIO $ readIORef envRef; env - return $ filter (\(_id, _) - _id/=id) env; -- clear the current scope valRef - liftIO $ newIORef val; liftIO $ writeIORef envRef $ ((id, valRef):env);

Re: [Haskell-cafe] Why can `env` be assigned value two times ?

2009-11-14 Thread Ross Mellgren
They're two different 'env's, which can be observed by desugaring the do-notation: do env - liftIO (readIORef envRef) env - return (filter (\(_id, _) - _id /= id) env) ... Desugaring do-notation gets us: liftIO (readIORef envRev) = \ env - return (filter (\(_id, _) - _id /= id) env) = \ env