dafny-lang / libraries

Libraries useful for Dafny programs
Other
43 stars 25 forks source link

Maps: add MapKeys, MapValues, and related helpers #86

Open alex-chew opened 1 year ago

alex-chew commented 1 year ago

This PR addresses a common use case where one wants to map an injective function over the keys of the map, retaining the values.

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

robin-aws commented 1 year ago

See also: https://github.com/dafny-lang/libraries/issues/119. I don't want to block on adding this under src/dafny as well but do want to track that work.

alex-chew commented 1 year ago

See also: https://github.com/dafny-lang/libraries/issues/119. I don't want to block on adding this under src/dafny as well but do want to track that work.

I'll take care of syncing to src/dafny as a follow-up, once this PR is finalized.