F#, purely functional port of Bob Nystrom's Bantam example