Bup routines in Haskell