Import from mlton upstream