[Haskell-beginners] checking file type (without getLine)

MJ Williams matthewjwilliams101 at gmail.com
Sun Dec 11 20:47:40 CET 2011


Hi guys,
When the hSetEncoding is set to utf8, getLine will attempt to read 
each line as belonging to a UTF-8 and when it encounters an error in 
the encoding it throws an exception.  I wonder if there's a way of 
checking for errors without getLine.  I didn't find any function or 
functions in System.IO that might do the job.  is there another 
library that I should be looking at?

Regards
Matthew




More information about the Beginners mailing list