January 2018

S M T W T F S
  123456
78910111213
14151617181920
21222324252627
28293031   

Style Credit

Expand Cut Tags

No cut tags
Tuesday, January 30th, 2007 12:01 pm (UTC)
Hey :) I'm [livejournal.com profile] totherme, good to meet you :)

I guess I learned haskell the Bird way - which isn't the way I think many hackers learn to code. We started with calculating interesting things, rather than with doing interesting things. It was quite a while before we bothered with monads at all, because there was plenty of other interesting stuff to do. This isn't a very "practical" way of doing things, of course - since pretty well all practical programmes require IO. Having said that, I think it's a good way of learning how functions work.

You're certainly right when you say that most haskell docs about monads try to teach you about monads in general. I think you're probably right when you suggest that this is suboptimal for a large percentage of people. I also think it's understandable - monads are a really cool abstraction, and most of the community are bursting with a joyous desire to share them with the world :)

(I've heard people suggest that they could be as ubiquitous as Objects in OO lanugages - a cool way of chopping stuff up, to be used everywhere - not just a weird hack to let you do IO)

From this point of view, I really like sigfpe's tutorial: You Could Have Invented Monads.

Having said that, it's probably as freaky to learn about monads this way as it is to learn about Objects for the first time... You remember learning/teaching that concept? Trying to understand/get across the difference between a class and an object, the meaning of instantiation, of inheritance, static things that live in all objects of a class at once, the "is a" relationship that inheritance should model... It's complex stuff - and a lot of people just want to write short, simple things. These are folk that don't need monads any more than they need a full object system. This is why languages like python and ruby allow you to write simple scripts, despite being OO languages.

From that point of view, the tutorial I like is dons' Programming Haskell series. He pretty well just tells you how to do things - in real contrast to the way I was taught. It looks like good stuff to me - but I'm not the target audience any more, and I haven't tried that tute out on any novices yet.

Now - those two links are both for someone who's doing their own thing, and needs to learn IO or monads in haskell - they're not full tutorials for teaching haskell. I'd feel wrong if I didn't at least mention YAHT. Where the above links are fairly to the point, YAHT is comprehensive. If someone asks me "What should I read to learn haskell?" - that's what I point them at. It's probably not relevant to this thread, but I like linking to it :)

As for the issue of haskell's syntax being different from most imperative languages - yeah, it is. This certainly does make it tougher to switch from imperative programming to haskell programming. I think the syntax is quite reasonable, and find that people who've never coded before don't have any problem with it. I've also heard some maths types (usually who've done little or no other coding) comment how easy it is to translate maths syntax into haskell syntax... So I guess those are the target audiences for the syntax: new coders and old mathematicians ;) For existing coders, I guess the best option is to point at the tour of the syntax, and hope it's user friendly enough :S

Reply

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting