export function intersection < T > ( a , b ) { return new Set < T > ( [ ... a ] . filter ( x => b . has ( x ) ) ) ; } export function difference < T > ( a , b ) { return new Set < T > ( [ ... a ] . filter ( x => ! b . has ( x ) ) ) ; }