first commit from http://code.haskell.org/~dons/code/hdirect/ (14-Feb-2010)