I would like a way to tell if every key-value pair of an Association
is contained in another. For instance, f[<|c -> 1, d -> 2|>, <|a -> 1|>]
should evaluate False
, but f[<|a -> 1, d -> 2|>, <|a -> 1|>]
should evaluate True
.
The functions SubsetQ
or ContainsAll
ought intuitively to do what I want, but they turn out only to operate on the values of an Association
, not the key-value pairs.
Currently the best I have is SubsetQ @@ Normal@*List@## &
. Is there a nicer (preferably in-built) way to do it than that, preferably which doesn't involve casting the whole lot to List
s? It's the kind of thing I'd expect there to be a built-in function for, but for the life of me I can't find it.