-- Sergio and Michael -- Tue Apr 12 17:02:35 PDT 2011 -- updated Thu Jul 6 14:02:15 PDT 2017 -- Determine whether there are duplicate values in a list {-# OPTIONS_CYMAKE -F --pgmF=currypp #-} import Test.EasyCheck -- execute with: curry check uniq -- prototypical implementation duplND (_++[x]++_++[x]++_) = True duplND'default _ = False -- production implementation duplD [] = False duplD (x:xs) = aux xs where aux (y:ys) = x==y || aux ys || duplD xs aux [] = False --tests sample = [[1,2,3],[2,3,2,4]] -- one no, another yes testND = map duplND sample testD = map duplD sample prop = testD -=- testND