/// Evaluate a value further, if it's now possible due to updates made to the
/// metavariable solutions.
Evaluate a value further, if it's now possible due to updates made to the
metavariable solutions.
Evaluate a value further if it ' s now possible due to updates made to the metavariable solutions .
pub fn force_value(
    prims: &prim::Env,
    metas: &meta::Env,
    value: &Rc<Value>,
) -> Result<Rc<Value>, String> {
    match value.as_ref() {
        Value::Neutral(Head::Meta(meta_level), spine) => match metas.lookup_solution(*meta_level) {
            Some((_, meta::Solution::Solved(value), _)) => {
                let value = spine.iter().fold(Ok(value.clone()), |head, elim| {
                    eval_elim(prims, metas, head?, elim)
                })?;
                force_value(prims, metas, &value)
            },
            Some((_, meta::Solution::Unsolved, _)) | None => Ok(value.clone()),
        },
        _ => Ok(value.clone()),
    }
}
pub fn force_value ( prims : & prim :: Env , metas : & meta :: Env , value : & Rc < Value > , ) -> Result < Rc < Value > , String > { match value . as_ref ( ) { Value :: Neutral ( Head :: Meta ( meta_level ) , spine ) => match metas . lookup_solution ( * meta_level ) { Some ( ( _ , meta :: Solution :: Solved ( value ) , _ ) ) => { let value = spine . iter ( ) . fold ( Ok ( value . clone ( ) ) , | head , elim | { eval_elim ( prims , metas , head ? , elim ) } ) ? ; force_value ( prims , metas , & value ) } , Some ( ( _ , meta :: Solution :: Unsolved , _ ) ) | None => Ok ( value . clone ( ) ) , } , _ => Ok ( value . clone ( ) ) , } }
Evaluate a value further, if it's now possible due to updates made to the
metavariable solutions.
Evaluate a value further if it ' s now possible due to updates made to the metavariable solutions .
prims
&prim::Env
metas
&meta::Env
value
&Rc<Value>