Zulip Chat Archive

Stream: std4

Topic: Rename RBSet.map to RBSet.mapMonotonic?


Chris Wong (Sep 26 2023 at 13:29):

The current RBSet.map requires that the mapping function is monotonic.

This differs from the convention in OCaml and Haskell, where the default map doesn't require monotonicity.

Can we rename this to mapMonotonic, and introduce a non-monotonic map f := ofList ∘ List.map f ∘ toList ?

Mario Carneiro (Sep 26 2023 at 13:37):

Finset also has separate map and image functions, with the former requiring injectivity

Chris Wong (Sep 26 2023 at 14:38):

Filed a PR: https://github.com/leanprover/std4/pull/274


Last updated: Dec 20 2023 at 11:08 UTC