> Does such a thing exists? Yes. See the lexer library in http://www.cse.unsw.edu.au/~chak/haskell/ctk/ You can use it without most of the other stuff and it is fast, too. Cheers, Manuel