fn sync_function(expr: &mut Expr, tys: Vec<&Type>) -> WeldResult<bool> {
    match expr.ty {
        Function(ref mut params, _) if params.len() == tys.len() => {
            let mut changed = false;
            for (param, ty) in params.iter_mut().zip(tys) {
                changed |= param.push(ty)?;
            }
            Ok(changed)
        }
        _ => compile_err!(
            "Expected function with {} arguments, but got {}",
            tys.len(),
            &expr.ty
        ),
    }
}
Force `expr`, which has kind `Lambda`, to have parameters that match `tys`.
weld/src/ast/type_inference.rs