in reply to Re^14: World's shortest intro to function programming
in thread Thread on Joel on software forum : "I hate Perl programmers."
I can't even think what chapter it would be in.
The implementation is shown on the lecture slides for CH.3.
I just assumed (probably wrongly) that it was drawn from the book. I will go find the book next time I'm in town (rare) and give it a good browse. I will say that I have learnt a lot from just the slides already and I thankyou for bringing it to my attention.
It's that 2D syntax thing biting you again. You need to indent the "name <- getLine" line in to match up with everything else...
Hmmm. Seems I used the tab key instead of the space key for that one line. Looked fine in my editor and I didn't notice the difference in the post till I just looked back. I'm still working on my editor configuration for Haskell. It now converts tabs to spaces on save.
The error message could be a little more informative.
GetArgs
I looked under System.Console; System.IO; System.Info; System.Process; System.Environment didn't get my attention. Before I discovered functional programming, I always thought there must be a better way of creating programs then I was currently doing.
Likewise, I really want to like Haskell. My point was not that Perl was perfect or that Haskell was in anyway limited--Autrijus is proving otherwise every day. I'd just really like to see a reasonably simple but complete program developed from start to finish, by a competent Haskell programmer, as a way of getting a step up into the use of the language.
With most Algol like languages, it is fairly easy for me to pick up the source to a program who's function I understand and learn by reading and modifying it. I've tried this with Haskell, but it is so different, not just in the layout, but the entire way of structuring the program, that even the simplest of real world examples leaves me wondering where to start.
Simple example: When should I use data, when type or newtype?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^16: World's shortest intro to function programming
by Anonymous Monk on Jun 20, 2005 at 20:07 UTC | |
|
Re^16: World's shortest intro to function programming
by Anonymous Monk on Jun 20, 2005 at 20:49 UTC | |
|
Re^16: World's shortest intro to function programming
by kelan (Deacon) on Jun 21, 2005 at 14:44 UTC | |
by BrowserUk (Patriarch) on Jun 21, 2005 at 20:17 UTC |