Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
module Memo =
let empty () = new Dictionary<int64,int64>()
let add k v (memo:Dictionary<int64,int64>) =
memo.[k] <- v; memo
let tryFind k (memo:Dictionary<int64,int64>) =
match memo.TryGetValue(k) with
| true, v -> Some(v)
| false,_ -> None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment