Saturday, February 14, 2009

THINKING FOLD

I first met OCaml in September 2006 (how sad life must have been before then), and I've since written (100-ε)% of my code in it. I'm happy to report that I'm emitting higher-order, fold-y code snippets like the following ever more frequently.

Hashtbl.fold (fun _ -> (+)) G.fidNumRegions 0

Update (7:17pm): I changed the data structure, so that line of code is no longer. Oh well, there will be others...

0 comments: