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
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
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
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
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, cycling
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
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 with the editor one
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
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 truly
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
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
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
(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 list.
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 will
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 (openFile myFile ReadMode)
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
Cale of
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 a
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
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 of
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
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 *both*
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]
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
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 run
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. Distrust
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
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
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 :-)
Whereas in
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.
Stefan O'Rear wrote:
Well... that's what I meant by break horribly.
Buh? That behaviour makes perfect sense to me.
b
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
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
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.
b
___
Haskell-Cafe mailing
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 print err Right fh
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
Cale of
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 reading:
35 matches
Mail list logo