moved from https://sourceforge.net/p/min-caml/code/