
-----Original Message----- From: Mark Carroll [SMTP:mark@chaos.x-philes.com] Sent: Wednesday, August 15, 2001 10:11 PM To: haskell-cafe@haskell.org Subject: Namespace clashes
When I use Haskell, I'm still tripping over reserved words; lately I tried to use 'type' as a data field name, for example, and was somewhat irritated to note that I can't. (Can I?) What gives me the willies is that
[Bryn Keller] Personally, I don't mind this sort of thing and I find the import capabilities in Haskell sufficient for most purposes. However, I'm new enough to Haskell that I sometimes have a hard time figuring out what I've done wrong from the error messages. Here's one such: func x = do data <- readFile x return data Where the problem is that I've mistakenly used the reserved word 'data' for a name binding. Here's the error message I get for that: scratch.hs:3: Empty 'do' construct But I'm learning. :-)

However, I'm new enough to Haskell that I sometimes have a hard time figuring out what I've done wrong from the error messages.
Any time I get an error message I don't understand, the first thing I do is to try a different compiler/interpreter, to see if it gives a better message.
func x = do data <- readFile x return data
Where the problem is that I've mistakenly used the reserved word 'data' for a name binding. Here's the error message I get for that:
scratch.hs:3: Empty 'do' construct
For instance, nhc98 gives this (hopefully more informative) message for the same error: In file ./scratch.hs: 3:13 Found _data_ but expected one of: <string> <char> <rational> <integer> ( [ <varid> <conid> _case_ _if_ _do_ _let_ \ ` <varop> <conop> ~ _ Regards, Malcolm
participants (2)
-
brk@jenkon.com
-
Malcolm Wallace