fn next_expected_param<'ty>(
    expected_scrutinee_param_tys: &mut impl Iterator<Item = domain::RcType>,
    expected_ty: &'ty domain::RcType,
) -> Option<(AppMode, domain::RcValue, Option<&'ty domain::AppClosure>)> {
    match expected_scrutinee_param_tys.next() {
        Some(param_ty) => Some((AppMode::Explicit, param_ty, None)),
        None => match expected_ty.as_ref() {
            domain::Value::FunType(app_mode, param_ty, body_ty) => {
                Some((app_mode.clone(), param_ty.clone(), Some(body_ty)))
            },
            _ => None,
        },
    }
}
/// Get the next expected parameter, by checking, in order:
///
/// - the next type synthesized from the scrutinees (if it exists)
/// - the next parameter from the expected type (if it exists)
Get the next expected parameter, by checking, in order:
the next type synthesized from the scrutinees (if it exists)
the next parameter from the expected type (if it exists)
Get the next expected parameter by checking in order : the next type synthesized from the scrutinees ( if it exists ) the next parameter from the expected type ( if it exists )
fn next_expected_param<'ty>(
    expected_scrutinee_param_tys: &mut impl Iterator<Item = domain::RcType>,
    expected_ty: &'ty domain::RcType,
) -> Option<(AppMode, domain::RcValue, Option<&'ty domain::AppClosure>)> {
    match expected_scrutinee_param_tys.next() {
        Some(param_ty) => Some((AppMode::Explicit, param_ty, None)),
        None => match expected_ty.as_ref() {
            domain::Value::FunType(app_mode, param_ty, body_ty) => {
                Some((app_mode.clone(), param_ty.clone(), Some(body_ty)))
            },
            _ => None,
        },
    }
}
fn next_expected_param < ' ty > ( expected_scrutinee_param_tys : & mut impl Iterator < Item = domain :: RcType > , expected_ty : & ' ty domain :: RcType , ) -> Option < ( AppMode , domain :: RcValue , Option < & ' ty domain :: AppClosure > ) > { match expected_scrutinee_param_tys . next ( ) { Some ( param_ty ) => Some ( ( AppMode :: Explicit , param_ty , None ) ) , None => match expected_ty . as_ref ( ) { domain :: Value :: FunType ( app_mode , param_ty , body_ty ) => { Some ( ( app_mode . clone ( ) , param_ty . clone ( ) , Some ( body_ty ) ) ) } , _ => None , } , } }
Get the next expected parameter, by checking, in order:
 the next type synthesized from the scrutinees (if it exists)
 the next parameter from the expected type (if it exists)
Get the next expected parameter by checking in order : the next type synthesized from the scrutinees ( if it exists ) the next parameter from the expected type ( if it exists )
expected_scrutinee_param_tys
&mut impl Iterator<Item = domain::RcType>
expected_ty
&'ty domain::RcType