elm-community / list-extra

Convenience functions for working with List.
http://package.elm-lang.org/packages/elm-community/list-extra/latest
MIT License
135 stars 58 forks source link

isPermutationOf: Add an edge-case the fuzz test missed #154

Closed Janiczek closed 2 years ago

Janiczek commented 2 years ago

The edge case actually helped disprove the validity of the implementation of isPermutationOf that I had in my head:

isPermutationOf xs ys =
  (List.length xs == List.length ys)
    && List.all (\x -> List.member x ys) xs
    && List.all (\y -> List.member y xs) ys
Chadtech commented 2 years ago

Great! Thanks @Janiczek