Lex using fold instead of map