An amazing functional

Martin Escardo and Paulo Oliva have been working on the selection monad and related functionals. The selection monad `S(X) = (X -> R) -> X` is a cousin of the continuation monad `C(X) = (X -> R) -> R` and it has a lot of useful and surprising applications. I recommend their recent paper “What Sequential Games, the Tychonoff Theorem and the Double-Negation Shift have in Common” which they wrote for MSFP 2010 (if you visit the workshop you get to hear Martin live). They explain things via examples written in Haskell, starting off with the innocently looking functional `ox` (which i I am writting as ox in Haskell for “crossed O”):

A small remark: I think the remark on laziness of p True versus if p True then True else False is nonsense. Both have the same behavior: they are strict in p, because forcing either expression will force p as well.

Maybe you’re thinking of a strict-by-default semantics with suspensions along the lines of Lazy (p True) versus if p True then Lazy True else Lazy False, but that’s not how it happens in Haskell.