This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |