more restrictive type for foldrOf