
23 Feb
2010
23 Feb
'10
9:08 a.m.
Am Dienstag 23 Februar 2010 14:54:36 schrieb Jonas Almström Duregård:
You are correct of course. Still, it will probably be a bit less inefficient if the length of the lists are compared (as opposed to the elements):
noneRepeated xs = length xs == length (nub xs)
Only if no repeated elements appear early. For xs = 1 : [1 .. 10^7], xs == nub xs will return False without noticeable delay, length xs == length (nub xs) will take VERY long.