It's a bit odd way of matching items of a list, I'd prefer to specify it without any possible trailing items:
[infile, outfile] <- getArgs
Also, the last two lines may be squeezed into one (though less readable): writeFile outfile =<< (unlines . sort . lines) `fmap` readFile infile