Updated for GHC 7.8 :-( Sad Steve