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 ?

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.

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

Vincent Siles has marked this topic as resolved.

Last updated: Jun 16 2024 at 03:41 UTC