Previously, I've talked a little about using literate programming for writing tutorials.
I just found The Haskell Road to Logic, Maths and Programming (via Lambda the Ultimate) in which they state that "the full source code of all programs is integrated in the book; in fact, each chapter can be viewed as a literate program in Haskell."
I haven't yet established if the book was actually written as a literate program or whether they are just saying it is like one. No indication, either, of how they express the evolution of the code in the source to the book.
But speculation aside and quite apart from the literate programming aspects of the book, it looks like a very nice book on foundational mathematics.
I think there is a certain flavour that programming brings to pure mathematics. The way I think of topics like abstract algebra is heavily influenced by both object-oriented and functional programming (see, for example, my observations about currying tensors.)