Skip to content

Instantly share code, notes, and snippets.

@matthewhammer
matthewhammer / ledger.did
Created May 18, 2021 22:27 — forked from ninegua/ledger.did
Internet computer ledger utility supporting 2 step transfer (separate sign and send)
type ICPTs = record {
e8s : nat64;
};
type Duration = record {
secs: nat64;
nanos: nat32;
};
type TimeStamp = record {
@matthewhammer
matthewhammer / incremental_eval_order_test.ml
Created September 16, 2016 13:34 — forked from khooyp/ incremental_eval_order_test.ml
Example of Incremental's height-based evaluation order leading to change propagation inconsistent with from-scratch evaluation, compared to Classic Adapton
module Inc = Incremental_lib.Incremental.Make ()
open Inc
let make init =
let num = 4 in
let den_v = Var.create init in
let den = Var.watch den_v in
(* computes "if den = 0 then 0 else num / den" *)
let div = bind den (fun den -> return (num / den)) in