Use foldl, foldr instead of categorySeqApply, categorySeqApply'.