Does ghc use Language.Haskell.*?

Hi, I've just coded a small utility to prettyprint my code, based on Language.Haskell.Parser and friends. Much to my surprise it wasn't able to parse itself, complaining about a non-ASC character (í). Why can ghc read the program, but not the standard library parser? Does ghc use something else? Is it possible to use whatever ghc uses to build a prettyprinter? Thanks, Maurício

On 2008 Dec 9, at 20:21, Maurí cio wrote:
Why can ghc read the program, but not the standard library parser? Does ghc use something else? Is it possible to use whatever ghc uses to build a prettyprinter?
Language.Haskell is known to be incomplete. The haskell-src-exts package on http://hackage.haskell.org will be more useful. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH

Why can ghc read the program, but not the standard library parser? Does ghc use something else? Is it possible to use whatever ghc uses to build a prettyprinter?
Language.Haskell is known to be incomplete. The haskell-src-exts package on http://hackage.haskell.org will be more useful.
Haskell-src-exts understands mode features, but I just tried using it and it seems it's also not Unicode aware. Thanks, Maurício

On Wed, 2008-12-10 at 09:32 -0200, Mauricio wrote:
Why can ghc read the program, but not the standard library parser? Does ghc use something else? Is it possible to use whatever ghc uses to build a prettyprinter?
Language.Haskell is known to be incomplete. The haskell-src-exts package on http://hackage.haskell.org will be more useful.
Haskell-src-exts understands mode features, but I just tried using it and it seems it's also not Unicode aware.
I'm just guessing here but I expect that haskell-src and haskell-src-exts are unicode aware but that you're using something like readFile to read your UTF-8 .hs file. The readFile function (currently) only reads text files in latin-1, not UTF-8. Try using the utf8-string package and the System.IO.UTF8.readFile function instead. Duncan
participants (4)
-
Brandon S. Allbery KF8NH
-
Duncan Coutts
-
Mauricio
-
Maurício