transducer like functions for hash-map