Non-H98 crusade, contd.

Andrew Pimlott andrew at pimlott.net
Mon Feb 28 16:03:22 EST 2005


On Mon, Feb 28, 2005 at 08:22:07PM +0000, Keith Wansbrough wrote:
> > > The reason
> > > was that error messages for beginners' code were rather baffling.
> > > (And pretty baffling for some experts too!)
> > 
> > I don't understand how they could be more baffling than any other type
> > errors involving monads.  Can you give an example?  (I could not find
> > any, only mentions of them.)  Maybe error messages were less clear then?
> > Or maybe understanding of monads was less pervasive?
> 
> Beginners are taught lists and list comprehensions before they are
> taught monads.  The errors they saw involved monads, which they didn't
> yet know about.  Confusion reigned.

Well, the original poster referred to baffled experts as well.  Anyway,
I agree that beginners are a concern, though I am wary of making
significant language decisions to accomodate them.  Some thoughts:

- Was main an IO action at that time?  Now that it is, beginners have to
  use monads pretty early on anyway.  (Ok, they probably use the repl
  first.)

- There could be a restricted form of the language in which
  comprehensions are always lists.  (And perhaps numeric literals get a
  base type?  And do is restricted to IO?)

- On the flip side, monad comprehensions could be a good way to
  introduce the power of Haskell.  Beginners can understand Maybe soon
  after understanding lists, so they could be shown Maybe
  comprehensions.  I've never tried to teach anyone Haskell, so I don't
  know how well this would work, but I'm not convinced that the right
  trade-off has been made.  This decision was made a long time ago, and
  maybe we can come up with better solutions now.

Andrew


More information about the Libraries mailing list