Skip to content

Refactor dedupBy to drop intermediary strict list with mapWithIndex.#22438

Open
yangzai wants to merge 1 commit intodigital-asset:mainfrom
yangzai:hy-dedup-by-refactor
Open

Refactor dedupBy to drop intermediary strict list with mapWithIndex.#22438
yangzai wants to merge 1 commit intodigital-asset:mainfrom
yangzai:hy-dedup-by-refactor

Conversation

@yangzai
Copy link
Copy Markdown
Contributor

@yangzai yangzai commented Nov 27, 2025

Relates to #20591.

let
indexed = zip xs [1..length xs]
comp x y = cmp (fst x) (fst y)
indexed = mapWithIndex (,) xs
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New indices are off by 1 and swapped, but these are inconsequential.

@yangzai yangzai force-pushed the hy-dedup-by-refactor branch from 0b63244 to 6f85264 Compare December 11, 2025 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant