query
On this page

uniqListExt

lib.uniqListExt

Docs pulled from | This Revision | 18 days ago
Deprecated


Contribute
Enhance the ecosystem with your expertise! Contribute to fill the gaps in documentation. Your input can make a difference.

Noogle detected

Aliases

Implementation

The following is the current implementation of this function.

{
      inputList,
      outputList ? [ ],
      getter ? (x: x),
      compare ? (x: y: x == y),
    }:
    if inputList == [ ] then
      outputList
    else
      let
        x = head inputList;
        isX = y: (compare (getter y) (getter x));
        newOutputList = outputList ++ (if any isX outputList then [ ] else [ x ]);
      in
      uniqListExt {
        outputList = newOutputList;
        inputList = (tail inputList);
        inherit getter compare;
      }