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 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 practical language for practical
> > > applications.
> > > It's easily remedied by teaching them a little IO up front (to
> > > show them it's not scary), and then leaving it alone for a while,
> > > having a more thorugough treatment of it later on.
> >
> > You can show them this on the first page:
> >
> > main = do
> >         x <- getLine()
> >         print my_program(x)
>
> Well, more like
>
> main = do x <- getLine
>                print (my_program x)

This:

main = do
        x <- getLine
        print (my_program x)

would be correct too. (Just to make it clear that the main point was not 
the different layout but the parentheses: Haskell uses them only to 
indicate precedence, they are not required around function arguments.)

Ben

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to