Re: [Haskell-cafe] Problem with Gtk2hs

2007-12-10 Thread Andrew Coppin
Duncan Coutts wrote: On Sat, 2007-12-08 at 13:08 -0800, Stefan O'Rear wrote: That's pretty obviously a bug - Graphics.UI.Gtk.Gdk.PixbufData doesn't fully implement the (M)Array class. The MArray class changed in ghc-6.8 and we didn't notice until the gtk2hs release was already out.

Re: [Haskell-cafe] I'm translating All about Monads to Chinese

2007-12-10 Thread Paulo J. Matos
On Dec 3, 2007 12:39 PM, Albert Lee [EMAIL PROTECTED] wrote: I have been confussed by monad for a long time. and I can't stand for it any more. so I start to translate the tutorial All About Monads to my mother language Chinese. My English is not good enough, so this work is only for my own

Re: [Haskell-cafe] Re: type class question

2007-12-10 Thread Jules Bean
Try again without missing out the list... Peter Padawitz wrote: Jules Bean wrote: Incidentally, I question why the compFoo are methods. Why not just make them polymorphic functions? They don't look like you expect instances to change them. The code continues to compile if I make them

Re: [Haskell-cafe] What is the role of $!?

2007-12-10 Thread Jules Bean
David Fox wrote: Here is a practical example I ran into a few days ago. With this expression: writeFile path (compute text) the file at path would be overwritten with an empty file if an error occurs while evaluating (compute text). With this one: writeFile path $! (compute text)

Re: [Haskell-cafe] Re: type class question

2007-12-10 Thread Peter Padawitz
Jules Bean wrote: Try again without missing out the list... Peter Padawitz wrote: Jules Bean wrote: Incidentally, I question why the compFoo are methods. Why not just make them polymorphic functions? They don't look like you expect instances to change them. The code continues to compile if

Re: [Haskell-cafe] Re: type class question

2007-12-10 Thread Jules Bean
Peter Padawitz wrote: What is so bad about making compFoo part of the class? It reduces the code (constraints can be avoided) and reflects the close connection between a signature Sig (implemented by the class) and the evaluation (compFoo) of Sig-terms in Sig-algebras. making it part of the

Re: [Haskell-cafe] Problem with Gtk2hs

2007-12-10 Thread Duncan Coutts
On Mon, 2007-12-10 at 10:40 +, Andrew Coppin wrote: What do I need to compile the darcs version? Just GHC? Or do I need the GTK+ header files? (Remember, I'm on Windows here.) Ah, that's a bit harder. It's not for the feint of heart. I've not updated the instructions in a while. The old

Re: [Haskell-cafe] IO is a bad example for Monads

2007-12-10 Thread Daniel Fischer
Am Montag, 10. Dezember 2007 10:36 schrieb Ketil Malde: Daniel Fischer [EMAIL PROTECTED] writes: Well, I guess you could get pretty far using 'interact' - far enough in an educational setting to do lists and Maybe, and then monads, before introducing monadic IO. Pretty far, yes, and in

Re: [Haskell-cafe] Re: type class question

2007-12-10 Thread Jules Bean
Peter Padawitz wrote: Jules Bean wrote: Peter Padawitz wrote: What is so bad about making compFoo part of the class? It reduces the code (constraints can be avoided) and reflects the close connection between a signature Sig (implemented by the class) and the evaluation (compFoo) of

Re: [Haskell-cafe] Re: Do real programs need IO? (was IO is a bad example for Monads)

2007-12-10 Thread Daniel Fischer
Am Montag, 10. Dezember 2007 07:05 schrieb Maurí­cio: (...) Would you deny that any useful programme has to do at least some of the following: -accept programme arguments at invocation -get input, be it from a keyboard, mouse, reading files, pipes... -output a result

Re: [Haskell-cafe] Problem with Gtk2hs

2007-12-10 Thread Andrew Coppin
Duncan Coutts wrote: On Mon, 2007-12-10 at 10:40 +, Andrew Coppin wrote: What do I need to compile the darcs version? Just GHC? Or do I need the GTK+ header files? (Remember, I'm on Windows here.) Ah, that's a bit harder. It's not for the feint of heart. I've not updated the

[Haskell-cafe] help

2007-12-10 Thread Ryan Bloor
hi I am writing a basic Parser from scratch. So far I have functions;# removeSpaces# match - which checks if a string is a substring of another# orParser which combines two parser's abilities# Basic pasrers like... parseInt, parseTrue, parseFalse, parseBoolusing the orParser on True and

Re: [Haskell-cafe] [OT] A nice organized collection of threads in Haskell-Cafe

2007-12-10 Thread Brandon S. Allbery KF8NH
On Dec 10, 2007, at 0:16 , Vimal wrote: What is the difference between In-Reply-To and References? In-Reply-To: specifies the immediate parent message in the tree; References: specifies a (possibly truncated) path back to the tree's root. -- brandon s. allbery

Re: [Haskell-cafe] help

2007-12-10 Thread Daniel Fischer
Am Montag, 10. Dezember 2007 14:45 schrieb Ryan Bloor: hi I am writing a basic Parser from scratch. So far I have functions;# removeSpaces# match - which checks if a string is a substring of another# orParser which combines two parser's abilities# Basic pasrers like... parseInt, parseTrue,

Re: [Haskell-cafe] Re: type class question

2007-12-10 Thread Peter Padawitz
Jules Bean wrote: Peter Padawitz wrote: Jules Bean wrote: Peter Padawitz wrote: What is so bad about making compFoo part of the class? It reduces the code (constraints can be avoided) and reflects the close connection between a signature Sig (implemented by the class) and the

Re: [Haskell-cafe] Re: type class question

2007-12-10 Thread Bertram Felgenhauer
Peter Padawitz wrote: Jules Bean wrote: I don't see why! In the class class Foo a where f :: a - Int g :: b - Integer g = fromIntegral . f The equations within the class are defaults, not equations. I must admit that I didn't know this... Nevertheless, won't you agree that

role of seq, $!, and bangpatterns illuminated with lazy versus strict folds Re: [Haskell-cafe] What is the role of $!?

2007-12-10 Thread Thomas Hartman
rather than ask the role of $! I found it helpful to first grasp the role of seq, since $! is defined in terms of seq and seq is a primitive operation (no prelude definition, like with IO, it's a given). What helped me grasp seq was its role in a strict fold. Basically, try to sum all the

Re: [Haskell-cafe] IO is a bad example for Monads

2007-12-10 Thread Dan Piponi
On Dec 10, 2007 4:51 AM, Daniel Fischer [EMAIL PROTECTED] wrote: Am Montag, 10. Dezember 2007 10:36 schrieb Ketil Malde: Daniel Fischer [EMAIL PROTECTED] writes: Various other people write: ... lots of talk about monads and IO ... When someone comes to me and says I have this Python

Re: [Haskell-cafe] IO is a bad example for Monads

2007-12-10 Thread Henning Thielemann
On Mon, 10 Dec 2007, Dan Piponi wrote: When someone comes to me and says I have this Python script that scans through these directories and finds the files that meet these criteria and generates a report based on this template, could I do it better in Haskell? it'd be good to have a better

Re: [Haskell-cafe] IO is a bad example for Monads

2007-12-10 Thread Wolfgang Jeltsch
Am Montag, 10. Dezember 2007 19:44 schrieb Dan Piponi: […] Maybe hardened Haskell programmers don't notice these things, but there's a wall that goes up when Haskell is presented to non-functional programmers. There are significant barriers for them to cross (some of them imaginary): That’s

Re: [Haskell-cafe] IO is a bad example for Monads

2007-12-10 Thread Wolfgang Jeltsch
Am Montag, 10. Dezember 2007 20:00 schrieb Henning Thielemann: […] I raise my question once again: Must Haskell's tutorials be tailored to impatient programmers? Does Haskell need quickdirty hackers? Who want Haskell to be plastered with syntactic sugar? ;-) ;-) Best wishes, Wolfgang

Re: [Haskell-cafe] IO is a bad example for Monads

2007-12-10 Thread Luke Palmer
On Dec 10, 2007 7:09 PM, Wolfgang Jeltsch [EMAIL PROTECTED] wrote: there's the fear that laziness can impact performance, Hmm, tell them that performance isn't all and that laziness helps you to write more modular programs. Nah, in this case I've found it's better to realistically compare

Re: [Haskell-cafe] Re: distinguish functions from non-functions in a class/instances

2007-12-10 Thread Dan Weston
Questioning apfelmus definitely gives me pause, but... id :: a - a-- arity 1 id = ($) :: (a - b) - (a - b) -- arity 2 I agree with the arities given above (but without quotes) and see no ill-definedness to arity. But these are two different classes of functions.

[Haskell-cafe] Software Tools in Haskell

2007-12-10 Thread Tommy McGuire
In the if anyone is interested,... department For reasons that remain unclear, early this fall I started translating Brian W. Kernighan and P.J. Plaugher's classic _Software Tools in Pascal_ into Haskell. I have completed most of it, up to the second part of chapter 8 which presents a

[Haskell-cafe] announcing darcs 2.0.0pre1, the first prerelease for darcs 2

2007-12-10 Thread David Roundy
We are happy to announce the first prerelease version of darcs 2! Darcs 2 will feature numerous improvements, and this prerelease will also feature a few regressions, so we're looking for help, from both Haskell developers and users willing to try this release out. Read below, to see how you can

Re: [Haskell-cafe] IO is a bad example for Monads

2007-12-10 Thread Dan Piponi
On Dec 10, 2007 11:00 AM, Henning Thielemann [EMAIL PROTECTED] wrote: Does Haskell need quickdirty hackers? The question isn't Does Haskell need quickdirty hackers? It's would we get better software (using your favourite metric) if we put Haskell into the hands of quick and dirty hackers?. I

Re[2]: [Haskell-cafe] IO is a bad example for Monads

2007-12-10 Thread Bulat Ziganshin
Hello Dan, Monday, December 10, 2007, 9:44:06 PM, you wrote: When someone comes to me and says I have this Python script that just my cent or two for this discussion: sometime ago I've started an introduction to IO tutorial. it's both not in English and not finished so i'll just explain its

Re: [Haskell-cafe] IO is a bad example for Monads

2007-12-10 Thread Ketil Malde
Dan Piponi [EMAIL PROTECTED] writes: The question isn't Does Haskell need quickdirty hackers? It's would we get better software (using your favourite metric) if we put Haskell into the hands of quick and dirty hackers?. I think the answer might be yes. This is an interesting trade-off: if

Re: [Haskell-cafe] IO is a bad example for Monads

2007-12-10 Thread Lennart Augustsson
If Haskell wants yo significantly widen it's audience then the tutorials have to cater for the impatient. Perhaps it's better to remain a fringe language. I truly don't know. -- Lennart On Dec 10, 2007 7:00 PM, Henning Thielemann [EMAIL PROTECTED] wrote: On Mon, 10 Dec 2007, Dan Piponi

Re: [Haskell-cafe] IO is a bad example for Monads

2007-12-10 Thread Paul Moore
On 10/12/2007, Henning Thielemann [EMAIL PROTECTED] wrote: On Mon, 10 Dec 2007, Dan Piponi wrote: When someone comes to me and says I have this Python script that scans through these directories and finds the files that meet these criteria and generates a report based on this template,

Re: [Haskell-cafe] IO is a bad example for Monads

2007-12-10 Thread jerzy . karczmarczuk
Paul Moore after Henning Thielemann after Dan Piponi: There are thousands of competing programming languages out there, and there are dozens that are viable choices for the task I just mentioned. If my response to their question takes longer than the time it would take to find another

Re: [Haskell-cafe] [OT] A nice organized collection of threads in Haskell-Cafe

2007-12-10 Thread Albert Y. C. Lai
Vimal wrote: What is the difference between In-Reply-To and References? There was a time In-Reply-To was for emails and References was for Usenet. Nowadays emails have both In-Reply-To and References. Usenet still sticks with just References. ___

Re: role of seq, $!, and bangpatterns illuminated with lazy versus strict folds Re: [Haskell-cafe] What is the role of $!?

2007-12-10 Thread Albert Y. C. Lai
Thomas Hartman wrote: -- (myfoldl f q ) is a curried function that takes a list -- If I understand currectly, in this lazy fold, this curried function isn't applied immediately, because -- by default the value of q is still a thunk myfoldl f z [] = z myfoldl f z (x:xs) = ( myfoldl f q ) xs

Re: [Haskell-cafe] IO is a bad example for Monads

2007-12-10 Thread Claus Reinke
Maybe hardened Haskell programmers don't notice these things, but there's a wall that goes up when Haskell is presented to non-functional programmers. There are significant barriers for them to cross (some of them imaginary): there's the infamous type system, there's the mystique around monads,

Re: [Haskell-cafe] What is the role of $!?

2007-12-10 Thread Dean Herington
Thanks, Tom, for a nice description of lazy evaluation. Besides the minor things Derek pointed out, there's one more subtle but important thing to correct: At 7:29 AM + 11/29/07, Thomas Davie wrote: $! is the special case, which means strictly apply. It evaluates its argument first,

Re: [Haskell-cafe] [OT] A nice organized collection of threads in Haskell-Cafe

2007-12-10 Thread Vimal
Hi, Thanks for the info. Vimal wrote: What is the difference between In-Reply-To and References? There was a time In-Reply-To was for emails and References was for Usenet. My friend wrote a parser for Haskell-cafe messages from the mailman archives as suggested. He told that there were a

Re: [Haskell-cafe] IO is a bad example for Monads

2007-12-10 Thread David Menendez
On Dec 10, 2007 1:44 PM, Dan Piponi [EMAIL PROTECTED] wrote: When someone comes to me and says I have this Python script that scans through these directories and finds the files that meet these criteria and generates a report based on this template, could I do it better in Haskell? it'd be

[Haskell-cafe] Re: group-by (Was: Nested guards?)

2007-12-10 Thread Anthony Clayden
Henning Thielemann lemming at henning-thielemann.de writes: On Fri, 7 Dec 2007, Simon Peyton-Jones wrote: | And I think that the solution is not to make the language larger and larger | everytime someone wants a feature but to give people the tools to provide | features without

Re: [Haskell-cafe] Re: distinguish functions from non-functions in a class/instances

2007-12-10 Thread Jonathan Cast
On 10 Dec 2007, at 11:33 AM, Dan Weston wrote: Questioning apfelmus definitely gives me pause, but... id :: a - a-- arity 1 id = ($) :: (a - b) - (a - b) -- arity 2 I agree with the arities given above (but without quotes) and see no ill-definedness to arity.

Re: [Haskell-cafe] IO is a bad example for Monads

2007-12-10 Thread Michael Vanier
I haven't been following this thread closely, but would it be rude to suggest that someone who doesn't want to put the effort into learning the (admittedly difficult) concepts that Haskell embodies shouldn't be using the language? Haskell was never intended to be The Next Big Popular Language.

Re: [Haskell-cafe] Re: group-by (Was: Nested guards?)

2007-12-10 Thread Henning Thielemann
On Tue, 11 Dec 2007, Anthony Clayden wrote: I agree with Henning that HAVING is a 'terrible hack', but then SQL altogether is a terrible hack. Somehow, yes. As that paper points out, HAVING is unnecessary - it's just a filter on the result set of group-by. Yep. It's crucial that in

Re: [Haskell-cafe] IO is a bad example for Monads

2007-12-10 Thread Donn Cave
On Dec 10, 2007, at 12:40 PM, Dan Piponi wrote: On Dec 10, 2007 11:00 AM, Henning Thielemann [EMAIL PROTECTED] wrote: Does Haskell need quickdirty hackers? The question isn't Does Haskell need quickdirty hackers? It's would we get better software (using your favourite metric) if we put

Re: [Haskell-cafe] IO is a bad example for Monads

2007-12-10 Thread Henning Thielemann
On Mon, 10 Dec 2007, Paul Moore wrote: On 10/12/2007, Henning Thielemann [EMAIL PROTECTED] wrote: I raise my question once again: Must Haskell's tutorials be tailored to impatient programmers? Does Haskell need quickdirty hackers? Haskell is the most practical functional language I have

Re: [Haskell-cafe] [OT] A nice organized collection of threads in Haskell-Cafe

2007-12-10 Thread Ketil Malde
Vimal [EMAIL PROTECTED] writes: Vimal wrote: What is the difference between In-Reply-To and References? There was a time In-Reply-To was for emails and References was for Usenet. My friend wrote a parser for Haskell-cafe messages from the mailman archives as suggested. One place to look