Skip to content

Instantly share code, notes, and snippets.

@adilakhter
Created February 26, 2013 02:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adilakhter/5035253 to your computer and use it in GitHub Desktop.
Save adilakhter/5035253 to your computer and use it in GitHub Desktop.
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