Compile iterate constraints for literals and lists.