added size to persistent list with a lambda and foldr