Haskell implementation of TeleHash