>>> union (fromList [(1,'a'),(2,'b')]) (fromList [(2,'c'),(3,'d')]) fromList [(1,'a'),(2,'b'),(3,'d')]
>>> union (fromList [1,2]) (fromList [2,3]) fromList [1,2,3]
(1 :| [3, 5, 3]) `union` (4 :| [5, 3, 5, 2]) == 1 :| [3, 5, 3, 4, 2]
>>> union (fromList [(1,'a'),(2,'b')]) (fromList [(2,'c'),(3,'d')]) fromList [(1,'a'),(2,'b'),(3,'d')]
>>> union (fromList [1,2]) (fromList [2,3]) fromList [1,2,3]
>>> "dog" `union` "cow" "dogcw"Duplicates, and elements of the first list, are removed from the the second list, but if the first list contains duplicates, so will the result. It is a special case of unionBy, which allows the programmer to supply their own equality test.