sequences sets ;
IN: assocs.extras
+: push-at-each ( value keys assoc -- )
+ '[ _ push-at ] with each ; inline
+
: deep-at ( assoc seq -- value/f )
[ of ] each ; inline
: expand-keys-push-at-as ( assoc exemplar -- hashtable' )
[
[ swap dup sequence? [ 1array ] unless ]
- [ '[ _ push-at ] with each ]
+ [ push-at-each ]
] dip assoc>object ;
: expand-keys-push-at ( assoc -- hashtable' )
[ neg swap pick at+ ] assoc-each
[ 0 > ] filter-values ;
-: push-at-each ( value keys assoc -- )
- '[ _ push-at ] with each ; inline
-
: collect-by-multi! ( ... assoc seq quot: ( ... obj -- ... key ) -- ... assoc )
[ keep swap ] curry rot [
[ push-at-each ] curry compose each