restore_graph_raw_owner.bend source
restore_graph_raw_owner.bend on the hub · documented module
import Baseimport ./decode_data.bend as Dimport ./restore_graph_data.bend as Snapshotimport ./restore_graph_raw.bend as Rawimport ./restore_raw.bend as Basictype Returned<Owner:Type,Runtime:Type,Output:Type> is Type: ParseRejected{owner:Owner,runtime:Runtime,original:D.Raw,error:Basic.Error} Delivered{original:D.Raw,output:Output}def parsed(~Owner:Type,~Runtime:Type,~Output:Type,~run:Owner -> Runtime -> Snapshot.Snapshot -> Output,+original:D.Raw,owner:Owner,runtime:Runtime,result:Raw.Parsed) -> Returned<Owner,Runtime,Output>: match result: case Raw.Rejected{input,error}:ParseRejected{owner,runtime,input,error} case Raw.Accepted{snapshot}:Delivered{original,run(owner,runtime,snapshot)}def run(~Owner:Type,~Runtime:Type,~Output:Type,~restore:Owner -> Runtime -> Snapshot.Snapshot -> Output,owner:Owner,runtime:Runtime,+input:D.Raw) -> Returned<Owner,Runtime,Output>: parsed(~Owner,~Runtime,~Output,~restore,input,owner,runtime,Raw.parse(input))