http://wadler.blogspot.ca/2014/03/propositions-as-types.html?m=1