[Haskell-cafe] A 3-line program that does not work

Philippos Apolinarius phi500ac at yahoo.ca
Sat Oct 24 16:27:39 EDT 2009

I have a friend who is an architect. I asked her why she does not use Haskell, since she is fond of functional programming. She writes her scripts in Clean, and needs to compile them before using them to generate postscript diagrams. In Haskell, I told her, she could use runghc, and skip the compilation step. She told me that she would consider switching to Haskell, and skipping the compilation step, if I could tell her how to write "façade" in Haskell.

C:\ghc\hastex>runghc tudin.hs

    lexical error in string/character literal (UTF-8 decoding error)

After browsing the Internet, I noticed that a many of people are having the same problem.  Could someone tell me what is wrong with my friend's program?

import System.IO

main= do
   outh <- openFile "garb.tsm" WriteMode
   hPutStrLn outh "A façade is the exterior of a building" 
   hClose outh
I would appreciate a "normal" solution, that is, I would like to type the text in any editor, or generate it with LaTeX macros, and compile it using ghc. 

Make your browsing faster, safer, and easier with the new Internet Explorer® 8. Optimized for Yahoo! Get it Now for Free! at http://downloads.yahoo.com/ca/internetexplorer/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20091024/a6a3be66/attachment.html

More information about the Haskell-Cafe mailing list