purescript-lists icon indicating copy to clipboard operation
purescript-lists copied to clipboard

Data.List.NonEmpty.intersect and Data.List.NonEmpty.intersectBy throw when intersection empty

Open evaogbe-vermeer opened this issue 2 years ago • 2 comments

I think they should be changed to match the implementation of the corresponding functions in NonEmptyArray, i.e. return a List instead of a NonEmptyList.

Alternatively, I saw the discussion in #184 about potentially removing the set functions from Array, List, NonEmptyList, NonEmptyArray, etc. and replacing them with an ordered set type. This might be more evidence supporting those who want to remove them.

evaogbe-vermeer avatar Dec 11 '23 21:12 evaogbe-vermeer

Ah yeah, they should definitely return List!

garyb avatar Dec 11 '23 21:12 garyb

Oops just realized I reported the issue on my work account. The PR with the fix is using the correct personal account.

evaogbe avatar Dec 14 '23 13:12 evaogbe