Commit dbeac9b3 authored by Simon Marlow's avatar Simon Marlow

Fix for GHC 6.12: use explict Latin-1 encoding for the input files

parent 6145027f
import System.Environment (getArgs)
import qualified Data.Set as Set
import System.IO
main = do
[file1,file2] <- getArgs
dict <- readFile file1
input <- readFile file2
dict <- readFileLatin1 file1
input <- readFileLatin1 file2
let set = Set.fromList (words dict)
let tocheck = words input
print (filter (`Set.notMember` set) tocheck)
readFileLatin1 f = do
h <- openFile f ReadMode
hSetEncoding h latin1
hGetContents h
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment