The following is an implementation of Newcombs problem in Haskell using a custom Template Haskell parser for do-notation.

newcomb-string-code