Re: [Haskell-cafe] Doubting Haskell

2008-03-05 Thread Richard A. O'Keefe
Concerning the Haskell program that does some statistics and displays some graphs, I must say that if that were the task I had to solve I would not use either C++ or Haskell, but R, the open source S lookalike. The best way to be productive as a programmer is to not write code if you can ste

Re: [Haskell-cafe] Doubting Haskell

2008-03-05 Thread Lennart Augustsson
Thanks for an interesting write-up. And not bad for a first Haskell program. :) There's still a number of things you could do to limit the boiler plate code, though. On Tue, Mar 4, 2008 at 6:29 AM, Alan Carter <[EMAIL PROTECTED]> wrote: > Many thanks for the explanations when I was first experim

Re: [Haskell-cafe] Doubting Haskell

2008-03-04 Thread Don Stewart
chaddai.fouche: > 2008/3/4, Alan Carter <[EMAIL PROTECTED]>: > > I've written up some reflections on my newbie experience together with > > both versions, which might be helpful to people interested in > > popularizing Haskell, at: > > > > http://the-programmers-stone.com/2008/03/04/a-first-has

Re: [Haskell-cafe] Doubting Haskell

2008-03-04 Thread Chaddaï Fouché
2008/3/4, Alan Carter <[EMAIL PROTECTED]>: > I've written up some reflections on my newbie experience together with > both versions, which might be helpful to people interested in > popularizing Haskell, at: > > http://the-programmers-stone.com/2008/03/04/a-first-haskell-experience/ This is tr

Re: [Haskell-cafe] Doubting Haskell

2008-03-04 Thread hjgtuyl
About the line length needed for Haskell programs, there was a discussion about this some time ago, that could be regarded as a tutorial for reducing indentation: http://haskell.org/pipermail/haskell-cafe/2007-July/028787.html As for the idle core you mention: I keep one core fully occupied w

Re: [Haskell-cafe] Doubting Haskell

2008-03-04 Thread Evan Laforge
> Especially if mixing tabs and spaces indeed. Haskell does the Python > thing of assuming that a tab is 8 spaces, which IMO is a mistake. The FWIW, most people in python land think the same thing, and the -t flag makes mixed tabs and spaces a warning or error. At the least, -Wall could report

Re: [Haskell-cafe] Doubting Haskell

2008-03-04 Thread Cale Gibbard
On 04/03/2008, Luke Palmer <[EMAIL PROTECTED]> wrote: > On Tue, Mar 4, 2008 at 4:16 AM, Ketil Malde <[EMAIL PROTECTED]> wrote: > > Paul Johnson <[EMAIL PROTECTED]> writes: > > > > > I'm surprised you found the significant whitespace difficult. > > > > I wonder if this has something to do wit

Re: [Haskell-cafe] Doubting Haskell

2008-03-04 Thread Paul Moore
On 04/03/2008, Alan Carter <[EMAIL PROTECTED]> wrote: > http://the-programmers-stone.com/2008/03/04/a-first-haskell-experience/ That was an interesting read. Thanks for posting it. I also liked the tale of the BBC ULA - it reminded me of a demo I saw once at an Acorn show, where they had a RISC PC

Re: [Haskell-cafe] Doubting Haskell

2008-03-04 Thread Luke Palmer
On Tue, Mar 4, 2008 at 4:16 AM, Ketil Malde <[EMAIL PROTECTED]> wrote: > Paul Johnson <[EMAIL PROTECTED]> writes: > > > I'm surprised you found the significant whitespace difficult. > > I wonder if this has something to do with the editor one uses? I use > Emacs, and just keep hitting TAB, cycl

Re: [Haskell-cafe] Doubting Haskell

2008-03-04 Thread Ketil Malde
Paul Johnson <[EMAIL PROTECTED]> writes: > I'm surprised you found the significant whitespace difficult. I wonder if this has something to do with the editor one uses? I use Emacs, and just keep hitting TAB, cycling through possible alignments, until things align sensibly. I haven't really tri

Re: [Haskell-cafe] Doubting Haskell

2008-03-04 Thread Paul Johnson
Alan Carter wrote: I've written up some reflections on my newbie experience together with both versions, which might be helpful to people interested in popularizing Haskell, at: http://the-programmers-stone.com/2008/03/04/a-first-haskell-experience/ Thank you for writing this. On the lack o

Re: [Haskell-cafe] Doubting Haskell

2008-03-03 Thread Alan Carter
Many thanks for the explanations when I was first experimenting with Haskell. I managed to finish translating a C++ wxWidgets program into Haskell wxHaskell, and am certainly impressed. I've written up some reflections on my newbie experience together with both versions, which might be helpful to

Re: [Haskell-cafe] Doubting Haskell

2008-02-22 Thread Thomas Davie
A quick note here. This is a *really* excellent tutorial on a variety of subjects. It shows how monad operators can be used responsibly (to clarify code, not obfuscate it), it shows how chosing a good data structure and a good algorithm can work wonders for your code, and on a simplistic

Re: [Haskell-cafe] Doubting Haskell

2008-02-21 Thread Yitzchak Gale
Cale Gibbard wrote: > I woke up rather early, and haven't much to do, so I'll turn this into > a tutorial. :) Cale, this is fantastic, as always. I often find myself searching for material like this when introducing people to Haskell. Would you be willing to put this on the wiki? Thanks, Yitz

Re: [Haskell-cafe] Doubting Haskell

2008-02-20 Thread Alan Carter
Cale, On Feb 20, 2008 10:58 AM, Cale Gibbard <[EMAIL PROTECTED]> wrote: > (I'm copying the list on this, since my reply contains a tutorial > which might be of use to other beginners.) Thank you so much for this - I've just started playing with it so few intelligent responses yet. I'm sure it wil

Re: [Haskell-cafe] Doubting Haskell

2008-02-20 Thread Cale Gibbard
(I'm copying the list on this, since my reply contains a tutorial which might be of use to other beginners.) On 19/02/2008, Alan Carter <[EMAIL PROTECTED]> wrote: > Hi Cale, > > On Feb 19, 2008 3:48 PM, Cale Gibbard <[EMAIL PROTECTED]> wrote: > > Just checking up, since you haven't replied on the

Re: [Haskell-cafe] Doubting Haskell

2008-02-17 Thread John Meacham
On Sat, Feb 16, 2008 at 05:04:53PM -0800, Donn Cave wrote: > But in Haskell, you cannot read a file line by line without writing an > exception handler, because end of file is an exception! as if a file does > not normally have an end where the authors of these library functions > came from? Part

Re: [Haskell-cafe] Doubting Haskell

2008-02-17 Thread Mads Lindstrøm
Hi Alan I can help but feeling curious. Did some of the answers actually help you? Are you still as doubtful about Haskell as when you wrote your email? Greetings, Mads Lindstrøm ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.ha

Re: [Haskell-cafe] Doubting Haskell

2008-02-17 Thread Philippa Cowderoy
On Sun, 17 Feb 2008, Anton van Straaten wrote: > Is there a benefit to reusing a generic Either type for this sort of thing? > For code comprehensibility, wouldn't it be better to use more specific > names? If I want car and cdr, I know where to find it. > It's Haskell's standard sum type, with

Re: [Haskell-cafe] Doubting Haskell

2008-02-17 Thread Thomas Schilling
On 17 feb 2008, at 08.46, Anton van Straaten wrote: Colin Paul Adams wrote: "Cale" == Cale Gibbard <[EMAIL PROTECTED]> writes: Cale> So, the first version: Cale> import System.IO import Control.Exception (try) Cale> main = do mfh <- try (openFile "myFile" ReadMode) case mfh Ca

Re: [Haskell-cafe] Doubting Haskell

2008-02-17 Thread Derek Elkins
On Sun, 2008-02-17 at 02:46 -0500, Anton van Straaten wrote: > Colin Paul Adams wrote: > >> "Cale" == Cale Gibbard <[EMAIL PROTECTED]> writes: > > > > Cale> So, the first version: > > > > Cale> import System.IO import Control.Exception (try) > > > > Cale> main = do mfh <- try (op

Re: [Haskell-cafe] Doubting Haskell

2008-02-16 Thread Jonathan Cast
On 16 Feb 2008, at 11:46 PM, Anton van Straaten wrote: Colin Paul Adams wrote: "Cale" == Cale Gibbard <[EMAIL PROTECTED]> writes: Cale> So, the first version: Cale> import System.IO import Control.Exception (try) Cale> main = do mfh <- try (openFile "myFile" ReadMode) case mfh

Re: [Haskell-cafe] Doubting Haskell

2008-02-16 Thread Anton van Straaten
Colin Paul Adams wrote: "Cale" == Cale Gibbard <[EMAIL PROTECTED]> writes: Cale> So, the first version: Cale> import System.IO import Control.Exception (try) Cale> main = do mfh <- try (openFile "myFile" ReadMode) case mfh Cale> of Left err -> do putStr "Error opening file for

Re: [Haskell-cafe] Doubting Haskell

2008-02-16 Thread Colin Paul Adams
> "Cale" == Cale Gibbard <[EMAIL PROTECTED]> writes: Cale> So, the first version: Cale> import System.IO import Control.Exception (try) Cale> main = do mfh <- try (openFile "myFile" ReadMode) case mfh Cale> of Left err -> do putStr "Error opening file for reading: " Cale>

Re: [Haskell-cafe] Doubting Haskell

2008-02-16 Thread Jonathan Cast
On 16 Feb 2008, at 5:04 PM, Donn Cave wrote: On Feb 16, 2008, at 3:46 PM, Philippa Cowderoy wrote: On Sat, 16 Feb 2008, Alan Carter wrote: I'm a Haskell newbie, and this post began as a scream for help. Extremely understandable - to be blunt, I don't really feel that Haskell is ready a

Re: [Haskell-cafe] Doubting Haskell

2008-02-16 Thread Bryan O'Sullivan
Stefan O'Rear wrote: > Well... that's what I meant by break horribly. Buh? That behaviour makes perfect sense to me. http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Doubting Haskell

2008-02-16 Thread Stefan O'Rear
On Sat, Feb 16, 2008 at 06:23:54PM -0800, Bryan O'Sullivan wrote: > Stefan O'Rear wrote: > > > I'll bet that breaks horribly in the not-so-corner case of /dev/tty. > > Actually, it doesn't. It seems to do a read behind the scenes if the > buffer is empty, so it blocks until you type something.

Re: [Haskell-cafe] Doubting Haskell

2008-02-16 Thread Bryan O'Sullivan
Stefan O'Rear wrote: > I'll bet that breaks horribly in the not-so-corner case of /dev/tty. Actually, it doesn't. It seems to do a read behind the scenes if the buffer is empty, so it blocks until you type something. http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Doubting Haskell

2008-02-16 Thread Stefan O'Rear
On Sat, Feb 16, 2008 at 05:11:59PM -0800, Bryan O'Sullivan wrote: > Donn Cave wrote: > > > But in Haskell, you cannot read a file line by line without writing an > > exception handler, because end of file is an exception! > > Ah, yet another person who has never found System.IO.hIsEOF :-) > > Wh

Re: [Haskell-cafe] Doubting Haskell

2008-02-16 Thread Bryan O'Sullivan
Donn Cave wrote: > But in Haskell, you cannot read a file line by line without writing an > exception handler, because end of file is an exception! Ah, yet another person who has never found System.IO.hIsEOF :-) Whereas in C or Python you would check the return value of read against zero or an e

Re: [Haskell-cafe] Doubting Haskell

2008-02-16 Thread Donn Cave
On Feb 16, 2008, at 3:46 PM, Philippa Cowderoy wrote: On Sat, 16 Feb 2008, Alan Carter wrote: I'm a Haskell newbie, and this post began as a scream for help. Extremely understandable - to be blunt, I don't really feel that Haskell is ready as a general-purpose production environment unle

Re: [Haskell-cafe] Doubting Haskell

2008-02-16 Thread Jefferson Heard
Since everyone's been focusing on the IO so far, I wanted to take a quick stab at his mention of "green" vs. OS threads... I like the term "green", actually, as it's what my grandmother calls decaffeinated coffee, owing to the fact that decaf taster's choice has a big green plastic lid. Distrus

Re: [Haskell-cafe] Doubting Haskell

2008-02-16 Thread Stefan O'Rear
On Sat, Feb 16, 2008 at 06:50:03PM -0500, Cale Gibbard wrote: > On 16/02/2008, Alan Carter <[EMAIL PROTECTED]> wrote: > > Then when all this was going on, question number five appeared: What > > the hell are these "lightweight Haskell threads"? Are they some kind > > of green threads running non-pr

Re: [Haskell-cafe] Doubting Haskell

2008-02-16 Thread Cale Gibbard
On 16/02/2008, Alan Carter <[EMAIL PROTECTED]> wrote: > Then when all this was going on, question number five appeared: What > the hell are these "lightweight Haskell threads"? Are they some kind > of green threads running non-preemptively inside a single OS thread? > Are they OS threads that could

Re: [Haskell-cafe] Doubting Haskell

2008-02-16 Thread Philippa Cowderoy
On Sat, 16 Feb 2008, Alan Carter wrote: > I'm a Haskell newbie, and this post began as a scream for help. Extremely understandable - to be blunt, I don't really feel that Haskell is ready as a general-purpose production environment unless users are willing to invest considerably more than usual

Re: [Haskell-cafe] Doubting Haskell

2008-02-16 Thread Robert Dockins
I'm going to try to respond the the main practical question in this message; perhaps others will feel up to addressing the more philosophical aspects. (I see now that Cale has beaten me to the punch, but I guess I'll post this anyways...) > Greetings Haskellers, [snip quite a bit of discussion]

Re: [Haskell-cafe] Doubting Haskell

2008-02-16 Thread Cale Gibbard
On 16/02/2008, Alan Carter <[EMAIL PROTECTED]> wrote: > Greetings Haskellers, > > I'm still hoping that this is solvable. That the instinctive > priorities of production programmers are just different to those of > researchers, and in fact it *is* possible to open a file *and* read > it, checking *

[Haskell-cafe] Doubting Haskell

2008-02-16 Thread Alan Carter
Greetings Haskellers, I'm a Haskell newbie, and this post began as a scream for help. Having slept on it I find myself thinking of Simon Peyton-Jones' recent request for good use cases. Perhaps a frustrated - and doubting - newbie can also provide a data point. If my worries are unfounded (and I h