query
On this page

allUnique

lib.allUnique

Docs pulled from | This Revision | 21 minutes ago


Check if list contains only unique elements. O(n^2) complexity.

Inputs

list

1. Function argument

Type

allUnique :: [a] -> bool

Examples

lib.lists.allUnique usage example

allUnique [ 3 2 3 4 ]
=> false
allUnique [ 3 2 4 1 ]
=> true
(lib.lists.allUnique)

Noogle detected

Aliases

Implementation

The following is the current implementation of this function.

allUnique = list: (length (unique list) == length list);