implement clock for haskell