Stream: Coq users

Topic: ✔ stdpp: map/iterate on gmap/stringmap


view this post on Zulip Vincent Siles (Nov 02 2021 at 13:15):

Hi ! again with questions on stdpp :) I'm looking to do something like List.map but on finite sets (gmap/stringmap). I can't seem to find an operation to do something like map (fun key value => f(key, val)) my_stringmap. Is there something like (K -> A -> B) -> gmap K A -> gmap K B in the library ?

view this post on Zulip MackieLoeffel (Nov 02 2021 at 13:24):

Hi Vincent, there is f <$> m which maps a function f : A → B over a gmap K A to get gmap K B. Also there is kmap of type (K1 → K2) → gmap K1 A → gmap K2 A. I am not aware of a function like <$> that also gives you access to the key.

view this post on Zulip Vincent Siles (Nov 02 2021 at 13:35):

Thanks Mackie. I'll see if I can reconsider and only use <$>

view this post on Zulip Notification Bot (Nov 24 2021 at 08:20):

Vincent Siles has marked this topic as resolved.


Last updated: Oct 13 2024 at 01:02 UTC