purescript-ordered-collections icon indicating copy to clipboard operation
purescript-ordered-collections copied to clipboard

Add function mapWithKey

Open flip111 opened this issue 1 year ago • 2 comments

Can mapWithKey be added for the times that you want to keep all items (opposed to mapMaybeWithKey)?

flip111 avatar Dec 22 '23 15:12 flip111

See the FunctorWithIndex instance https://github.com/purescript/purescript-ordered-collections/blob/313ec0c3556854cd4e4752a77a86b102fc41ad05/src/Data/Map/Internal.purs#L150

natefaubion avatar Dec 22 '23 16:12 natefaubion

Thanks @natefaubion

Can a hint be added to documentation here? https://github.com/purescript/purescript-ordered-collections/blob/db50eee71868f743dab9f2f2675b4e0bd1e75839/src/Data/Map/Internal.purs#L651-L652

flip111 avatar Dec 22 '23 16:12 flip111