add a code snippet from Gabriel Gonzalez
https://groups.google.com/forum/#!topic/haskell-pipes/BTQsITNwflc