Difference between Char and Data.Char modules

I just started looking at the Happy packag; I get a compile error when attempting to build examples/glr/expr-eval: ExprData.hs:9:8: Could not find module `Char' It is a member of the hidden package `haskell98-2.0.0.1'. ExprData.hs:9 says “import Char” and if I change this to “import Data.Char” it compiles correctly (then I get a similar message for System, but when I understand Char I expect I will understand this too). Could someone kindly explain the difference between these two modules? From the look of the error, I’m guessing there’s a history lesson involved? Thanks, Ken ________________________________ This email and any attachments may contain information which is confidential and/or privileged. The information is intended exclusively for the addressee and the views expressed may not be official policy, but the personal views of the originator. If you are not the intended recipient, be aware that any disclosure, copying, distribution or use of the contents is prohibited. If you have received this email and any file transmitted with it in error, please notify the sender by telephone or return email immediately and delete the material from your computer. Internet communications are not secure and Lab49 is not responsible for their abuse by third parties, nor for any alteration or corruption in transmission, nor for any damage or loss caused by any virus or other defect. Lab49 accepts no liability or responsibility arising out of or in any way connected to this email.

Char dates from the Haskell 98 specification, before hierarchical modules were standardised. Data.Char is the newer hierarchical module - it has been the de facto standard for a long time. Haskell 98 is still supported by GHC but it is no longer the default - I think you have to provide flags at the command line to get H98 automatically. I'm not sure if the GLR (or attribute grammar) bits of Happy are actively used, so you might expect a few infelicities if you try to use them.

On Thu, Jun 14, 2012 at 08:27:11PM +0100, Stephen Tetley wrote:
Char dates from the Haskell 98 specification, before hierarchical modules were standardised. Data.Char is the newer hierarchical module - it has been the de facto standard for a long time.
Not only has it been the de facto standard for a long time, it is now the official standard, since hierarchical module names are included in the Haskell 2010 standard. -Brent

Thanks; is there a better, more current example that you know of where I might start instead?
----- Original Message -----
From: Stephen Tetley [mailto:stephen.tetley@gmail.com]
Sent: Thursday, June 14, 2012 03:27 PM
To: Ken Overton
Cc: beginners@haskell.org

Hi Ken
If you don't want GLR parsing (or attribute grammars) the Happy docs
should be fine. GHC uses Happy, though an LR grammar, for its front
end, so regular LR parsing always works.
If you want GLR you might want to search the web to find out who
authored the GLR extension. I'm afraid I've forgotten the person, but
I seem to remember there was a thesis (possibly United Kingdom MSc ?)
accompanying it.
IIRC, the Happy GLR extension seemed to focus on natural language
parsing rather than parsing ambiguous programming languages (Happy is
generally used just to parse programming languages rather than natural
language). The GLR parsing algorithm originally came from Natural
Language Processing but because it handles ambiguity it was adopted by
compiler developers. In practice, industrial strength GLR parsers for
programming languages (e.g. SGLR and the commercial DMS from Semantic
Designs) add a fair amount of kit so they can disambiguate what they
parse and make good parse trees - I don't think Happy's GLR extension
had this.
On 14 June 2012 20:43, Ken Overton
Thanks; is there a better, more current example that you know of where I might start instead?
participants (3)
-
Brent Yorgey
-
Ken Overton
-
Stephen Tetley