chickadee » transducers » zip-hashmap

zip-mapping mappingprocedure
zip-hashmap hashmapprocedure

A transducer that zips each of the (key . value) pairs in the relevant mapping / hashmap over the current transduction.

 
(import (only (srfi 128)
              make-default-comparator)
        (srfi 146)
        (srfi 146 hash)
        transducers)

(transduce mapping-fold
           (zip-hashmap (hashmap (make-default-comparator)
                                 "foo" 'bar
                                 "fzz" 'baz))
           (collect-list)
           (mapping (make-default-comparator)
                    "abc" 'def
                    "eef" 'ghi))

; => ((("abc" . def) "fzz" . baz) (("eef" . ghi) "foo" . bar))