Hi > unique = unique' [] > > unique' _ [] = [] > unique' history (x:xs) = if x `elem` history > then next > else (x:next) where next = (uniq' (x:hist) xs) You can express this more neatly: unique' _ [] = [] unique' history (x:xs) = [x | x `notElem` history] ++ unique' (x:history) xs Thanks Neil