MCPcopy Create free account
hub / github.com/argumentcomputer/ix / decode

Method decode

crates/ffi/src/ix/constant.rs:54–62  ·  view source on GitHub ↗

Decode Ix.ConstantVal from Lean object. ConstantVal = { name : Name, levelParams : Array Name, type : Expr }

(&self)

Source from the content-addressed store, hash-verified

52 /// Decode Ix.ConstantVal from Lean object.
53 /// ConstantVal = { name : Name, levelParams : Array Name, type : Expr }
54 pub fn decode(&self) -> ConstantVal {
55 let ctor = self.as_ctor();
56 let name = LeanIxName(ctor.get(0)).decode();
57 let level_params: Vec<Name> =
58 ctor.get(1).as_array().map(|x| LeanIxName(x).decode());
59 let typ = LeanIxExpr(ctor.get(2)).decode();
60
61 ConstantVal { name, level_params, typ }
62 }
63}
64
65// =============================================================================

Callers 1

Calls 3

as_arrayMethod · 0.80
tagMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected