! helper function for group-by - takes a sequence and a function of records ! to keys, and returns an associative list of keys to records. ! TODO: might need a swap after the map to get the key-value ordering right. : extract-keys ( seq quot: ( a -- b ) -- alist ) [ dup ] dip map zip ;