On 2005-12-20, Daniel Carrera [EMAIL PROTECTED] wrote:
Hi all,
I've finished a first draft of what I call First steps in Haskell.
It's intended to be the very first thing a new user sees when they
decide to try out Haskell.
I should point out a parallel effort that a few of us have worked
Hello Daniel,
Wednesday, December 21, 2005, 6:34:10 PM, you wrote:
DC You can show them this on the first page:
DC main = do
DC x - getLine()
DC print my_program(x)
this named `interactive` :) try:
main = interactive(map toUpper)
--
Best regards,
Bulat
Hello Bill,
Wednesday, December 21, 2005, 6:38:33 PM, you wrote:
BW PS: While looking over my post it occurred to me that the issue is at
BW least as much methodological as it is linguistic. So I ask: Does
BW Haskell stand far enough apart from other programming languages to
BW warrant
Hello Daniel,
Thursday, December 22, 2005, 3:13:06 PM, you wrote:
DC Well, I'm a newbie, and I wrote it. I have enough understanding to
DC generate that code, even if I don't understand it all. This is what I know:
please, don't learn Haskell!!! we will test different tutorials on
you! :)))
Hello John,
Thursday, December 22, 2005, 3:48:37 AM, you wrote:
JM You can't not start with IO for people who already know how to program,
JM if you are teaching someone programming for the very first time then
JM starting with the pure functional side is fine. But for people that
JM already
S Koray Can wrote:
As a newbie... I agree that a newbie should be able to write this
fairly early on:
main = do
x - getLine()
putStrLn (The answer is ++ show(fib(read(x
I'd agree for some definition of 'early'. I'll elaborate:
[snip]
The above code snippet contains
On 12/22/05, Daniel Carrera [EMAIL PROTECTED] wrote:
S Koray Can wrote:
As a newbie... I agree that a newbie should be able to write this
fairly early on:
main = do
x - getLine()
putStrLn (The answer is ++ show(fib(read(x
I'd agree for some definition of
On 12/22/05, John Meacham [EMAIL PROTECTED] wrote:
Just the idea that you can write things like mapM and replicateM is
enough to blow the mind of many impertive programmers.
Not trying to fan the flames, but one thing I struggle with is
understanding (at a gut level - if you explain the theory,
On Thu, 22 Dec 2005, Paul Moore wrote:
...
FWIW, I don't really see why the -M functions are needed either. It's
something to do with the fact that map is for lists, and mapM is for
monads, which are a more general type of sequence than a list. But why
mapM isn't therefore a superset of map,
On Thu, Dec 22, 2005 at 02:02:56PM +, Daniel Carrera wrote:
I had never heard of mapM, or other -M functions. I can't imagine why
those would be needed. It seems like pointless duplication.
(!!!) then you are missing out. the M functions (and monadic traversal
functions in general)
On 12/22/05, Daniel Carrera [EMAIL PROTECTED] wrote:
Paul Moore wrote:
As I say, I'm not trying to criticize anyone here, but it seems to be
quite hard to get across to people who have understood and assimilated
this sort of stuff, just how hard it feels to newcomers. We understand
the
SKC This entire discussion is about 'breaking a cyclic graph of conceptual
SKC dependencies'. Unfortunately, I don't think it can be done well in short
SKC amount of time.
I bet if we sat down and listed all the concepts required to write
idiomatic Haskell (even idiomatic Haskell 98 (whatever
Paul Moore wrote:
Not trying to fan the flames, but one thing I struggle with is
understanding (at a gut level - if you explain the theory, I'll
understand, but go away none the wiser in practice...) why I need mapM
as well as map (and all the other -M functions, liftM, foldM, etc...)
All you
Neil Mitchell [EMAIL PROTECTED] writes:
I would have actually said Hugs, and especially the Windows front end
WinHugs was a lot more suitable for beginners than GHC, but the wiki
page very much gives the other impression.
Which page are you referring to? I went to look, but couldn't find
any
On Wed, 21 Dec 2005, Robin Green wrote:
Henning Thielemann wrote:
Starting with IO in Haskell is like starting LaTeX with rotating text and
making it colorful.
Not at all!
Indeed IO _is_ complicated regardless of whether it is
modelled by Monads in Haskell or differently in other
Robin Green wrote:
Whilst localising IO to a small part of the program is generally a good
idea, beginners should not be scared off by the thought that IO in
Haskell is so hard it has to be covered on page 94. This is not the
case. It should be introduced on page 1.
As a newbie... I'll agree
Robin Green wrote:
If people want Haskell to be treated as a practical language, not just
something for doing academic teaching and research with, it should be
taught as a practical language - which means that things like IO and
space/time usage come to the forefront.
Strange, I always
On Wed, 21 Dec 2005, Robin Green wrote:
Henning Thielemann wrote:
Starting with IO in Haskell is like starting LaTeX with rotating text and
making it colorful.
Not at all!
Indeed IO _is_ complicated regardless of whether it is
modelled by Monads in Haskell or differently in other
On Wed, 21 Dec 2005, Creighton Hogg wrote:
I agree with this wholeheartedly. When I first started
playing with Haskell, some of the tutorials made it look
like it was very difficult to do anything practical with it
because doing real input and output seemed like an advanced
topic.
The
Udo Stenzel wrote:
Strange, I always thought predictable, understandable and above all
correct code would be the primary goal, with small and quick code coming
later.
Depends on what you mean by quick and small. Do you mean that the
program should execute fast and have a small memmory
Henning Thielemann wrote:
IO is always complicated:
I have never once thought it was complicated. All I've ever needed are
print() and readLine() and those shouldn't be complicated IMO. And I
wouldn't want to wait for page 120 to learn how to do that. My programs
are not going to be useful
On Wed, 21 Dec 2005, Henning Thielemann wrote:
On Wed, 21 Dec 2005, Creighton Hogg wrote:
I agree with this wholeheartedly. When I first started
playing with Haskell, some of the tutorials made it look
like it was very difficult to do anything practical with it
because doing real
On 21/12/05, Daniel Carrera [EMAIL PROTECTED] wrote:
Henning Thielemann wrote:
IO is always complicated:
I have never once thought it was complicated. All I've ever needed are
print() and readLine() and those shouldn't be complicated IMO. And I
wouldn't want to wait for page 120 to learn
--
Message: 1
Date: Wed, 21 Dec 2005 10:48:08 +
From: Robin Green [EMAIL PROTECTED]
Subject: Re: [Haskell-cafe] Re: Tutorial uploaded
Beginners should start with non-monadic functions in order to later avoid
IO
On Wed, 21 Dec 2005, Creighton Hogg wrote:
On Wed, 21 Dec 2005, Henning Thielemann wrote:
The drawback is that I saw many Haskell programs implemented with IO
read/write functions which could be easily implemented without IO, using
laziness.
Can you think of any examples of things like
Am Dienstag, 20. Dezember 2005 20:07 schrieb Sebastian Sylvan:
[...]
It's sometimes beneficial to lie a bit when starting out. Perhaps
say something like this is a simplified view of things, for all the
gory details see chapter 19.
Monadic IO is pretty darn cool, sadly that means that many
Am Mittwoch, 21. Dezember 2005 11:48 schrieb Robin Green:
[...]
If people want Haskell to be treated as a practical language, not just
something for doing academic teaching and research with, it should be
taught as a practical language - which means that things like IO and
space/time usage
Daniel Carrera wrote:
Depends on what you mean by quick and small. Do you mean that the
program should execute fast and have a small memmory foot-print?
I was referring to Robin's mentioning space/time usage, so yes, that's
what I meant.
To write interactive Haskell code well, you have to
Creighton Hogg wrote:
On Wed, 21 Dec 2005, Henning Thielemann wrote:
The drawback is that I saw many Haskell programs implemented with IO
read/write functions which could be easily implemented without IO, using
laziness.
Can you think of any examples of things like that? Given
that
Robin Green wrote:
I meant that for *many* but not all
practical programming tasks, IO is important.
...web applications...
Ha, wrong! A CGI script only needs getEnv, getContents and putStr, if
it has persistent state, it also needs readFile and writeFile. Each of
the five is called exactly
Am Mittwoch, 21. Dezember 2005 13:31 schrieb Daniel Carrera:
Udo Stenzel wrote:
Strange, I always thought predictable, understandable and above all
correct code would be the primary goal, with small and quick code coming
later.
Depends on what you mean by quick and small. Do you mean that
Udo Stenzel wrote:
Unless you want to
teach people to program as they would do in Basic, that is.
I don't know what you mean by that.
You will soon. Once you get used to composing functions instead of
sequencing actions, you'll appreciate the difference.
Ah.
Yes, I do think I understand
On 12/21/05, John Hughes [EMAIL PROTECTED] wrote:
--
Message: 1
Date: Wed, 21 Dec 2005 10:48:08 +
From: Robin Green [EMAIL PROTECTED]
Subject: Re: [Haskell-cafe] Re: Tutorial uploaded
Beginners should
Daniel Fischer wrote:
P.S.: In May, there was a 'Daniel Carrera' around, too. Isn't that a strange
coincidence?
That was myself, using a different email address. I didn't get too far
with Haskell that time, but I remembered that I liked it, so I'm going
back to it a bit now. But I'm still a
On 12/21/05, Wolfgang Jeltsch [EMAIL PROTECTED] wrote:
Am Dienstag, 20. Dezember 2005 20:07 schrieb Sebastian Sylvan:
[...]
It's sometimes beneficial to lie a bit when starting out. Perhaps
say something like this is a simplified view of things, for all the
gory details see chapter 19.
On 12/21/05, Wolfgang Jeltsch [EMAIL PROTECTED] wrote:
Am Mittwoch, 21. Dezember 2005 11:48 schrieb Robin Green:
[...]
If people want Haskell to be treated as a practical language, not just
something for doing academic teaching and research with, it should be
taught as a practical
Sebastian Sylvan wrote:
Well, I certainly disagree there.
I'm not advocating going into a full-blown explanation of monads, just
enough to actually be able to write a real stand-alone program after
the first chapter. They only need to know that do-notation is for
sequencing computations, and (-)
Sebastian Sylvan wrote:
Beginners know that too. In fact, they often think that practical
applications need far more IO than they really do! So to insinuate
even slightly that Haskell is bad at IO by avoiding it for two
thirds of a book, is really going to inforce the idea that Haskell
isn't a
On Wed, 2005-12-21 at 13:10 +0100, Udo Stenzel wrote:
. . .
tutorial. Before that, IO should be restricted to the EVA principle
(Eingabe, Verarbeitung, Ausgabe == Input, Processing, Output). It
was a good principle in the 60s, and it still is. Unless you want to
teach people to program
On 12/21/05, Daniel Carrera [EMAIL PROTECTED] wrote:
Sebastian Sylvan wrote:
Beginners know that too. In fact, they often think that practical
applications need far more IO than they really do! So to insinuate
even slightly that Haskell is bad at IO by avoiding it for two
thirds of a
Am Mittwoch, 21. Dezember 2005 16:30 schrieb Daniel Carrera:
[...]
Would it be fair to say that do-blocks are imperative blocks in an otherwise
functional program?
Not really. do expressions are (normally) equivalent to expressions
containing applications of (=) and/or (). If the monad you
On Wed, 21 Dec 2005, Udo Stenzel wrote:
[... re pitfalls of IO for the beginner ]
Here's another one: I've heard a fellow claim, Haskell is basically
unsuitable to implement a compiler, because Haskell is weak at IO and
everything needs IO, the lexer, the preprocessor, the parser, the
Donn Cave wrote:
Meanwhile, that fellow evidently didn't write any compiler in Haskell
at all. Better a C++ program than a Haskell program that offends you?
Oh no, he actually wrote something disgusting built mostly out of
regexes in Perl. I don't think it even works, and I don't think I
Some example for writing a text the IO oriented way:
do putStrLn bla
replicateM 5 (putStrLn blub)
putStrLn end
whereas the lazy way is
putStr (unlines ([bla] ++ replicate 5 blub ++ [end]))
Um, maybe it's just me, but I think the first program is far
superior to the
On Wed, Dec 21, 2005 at 07:35:28PM +0100, Peter Simons wrote:
Some example for writing a text the IO oriented way:
do putStrLn bla
replicateM 5 (putStrLn blub)
putStrLn end
whereas the lazy way is
putStr (unlines ([bla] ++ replicate 5 blub ++ [end]))
Um, maybe
On Wed, 21 Dec 2005, Peter Simons wrote:
Some example for writing a text the IO oriented way:
do putStrLn bla
replicateM 5 (putStrLn blub)
putStrLn end
whereas the lazy way is
putStr (unlines ([bla] ++ replicate 5 blub ++ [end]))
Um, maybe it's just me, but I
On Wednesday 21 December 2005 18:48, Udo Stenzel wrote:
Donn Cave wrote:
Meanwhile, that fellow evidently didn't write any compiler in
Haskell at all. Better a C++ program than a Haskell program that
offends you?
Oh no, he actually wrote something disgusting built mostly out of
regexes
On Wed, Dec 21, 2005 at 09:30:14PM +, Philippa Cowderoy wrote:
On Wed, 21 Dec 2005, Tomasz Zielonka wrote:
I don't know how it's done, but when you compile it with 'ghc -O2',
the program runs in constant space. Unfortunately with Hugs and GHCi it
grows.
The live set, or just the
On 21/12/05, Tomasz Zielonka [EMAIL PROTECTED] wrote:
On Wed, Dec 21, 2005 at 07:13:07PM +, Philippa Cowderoy wrote:
Try running
putStrLn (unlines (repeat hello!))
You may be surprised ;-)
Or not ;-) But yes, I should've checked and my comments on how that'll
behave
On Wednesday 21 December 2005 12:17, Daniel Carrera wrote:
Robin Green wrote:
Whilst localising IO to a small part of the program is generally a
good idea, beginners should not be scared off by the thought that
IO in Haskell is so hard it has to be covered on page 94. This is
not the
As a newbie... I'll agree with Robin. I /did/ think that IO in
Haskell was probably very difficult because it's covered in page 94.
I skimmed through YAHT and IO is covered wyyy deep into the
document. I haven't read that section yet, but there is a lot of
content and to me it looked
noise
The truth is, Haskell friggen rocks at IO compared to imperative
languages. We are all spoiled and see IO in haskell as ugly because we
have been exposed to the pure functional goodness of the rest of
haskell. but teaching haskell as a better impertive language than
imperative ones from the
On Wednesday 21 December 2005 16:49, Sebastian Sylvan wrote:
On 12/21/05, Daniel Carrera [EMAIL PROTECTED] wrote:
Sebastian Sylvan wrote:
Beginners know that too. In fact, they often think that practical
applications need far more IO than they really do! So to
insinuate even slightly
Daniel Carrera wrote:
As a newbie... I agree that a newbie should be able to write this fairly
early on:
main = do
x - getLine()
putStrLn (The answer is ++ show(fib(read(x
I'd agree for some definition of 'early'. I'll elaborate:
This entire discussion is about 'breaking
== So how do I write Hello, world? ==
Well, the first thing you need to understand that in a
functional language like Haskell, this is a harder
question than it seems. Most of the code you will write
in Haskell is purely functional, which means that it
returns the same thing every
On 20 Dec 2005 19:52:31 +0100, Peter Simons [EMAIL PROTECTED] wrote:
== So how do I write Hello, world? ==
Well, the first thing you need to understand that in a
functional language like Haskell, this is a harder
question than it seems. Most of the code you will write
in Haskell
Peter Simons wrote:
In my humble
opinion, it's unfortunate that many tutorials and
introductionary texts leave the impression that monadic code
would be something utterly different than normal Haskell
code. I feel it intimidates the reader by making a monad
appear like black magic, even though
Daniel Carrera writes:
I'm scared of monads :) I really don't know what a monad
is.
Neither do I, but that doesn't mean that I can't use just
fine. ;-)
putStrLn :: String - World - World
That seems less scary.
Things become a lot clearer when you think about how to
print _two_ lines
On Tue, 2005-12-20 at 20:07 +0100, Sebastian Sylvan wrote:
. . .
I'm still looking for a good *practical* tutorial that I could
recommend to newcomers.
IO, data types and QuickCheck in the very first chapter, I say! Real
program examples from the get go, and go into the theory on why this
Hi,
Hugs Interpreter onlySuitable for learning. You'll need GHC for
serious work.
This is putting Hugs down quite a bit. I personally prefer Hugs, and
use it for serious work (including developing a Haskell compiler, and
4 years of academic study and counting). About the only thing
On Tuesday 20 December 2005 20:58, Peter Simons wrote:
Daniel Carrera writes:
I'm scared of monads :) I really don't know what a monad
is.
Neither do I, but that doesn't mean that I can't use just
fine. ;-)
putStrLn :: String - World - World
That seems less scary.
Things
Hello Neil,
Tuesday, December 20, 2005, 11:52:51 PM, you wrote:
NM Hi,
Hugs Interpreter onlySuitable for learning. You'll need GHC for
serious work.
NM This is putting Hugs down quite a bit. I personally prefer Hugs, and
NM use it for serious work (including developing a Haskell
62 matches
Mail list logo