fromList [] == empty fromList [(5,"a"), (3,"b"), (5, "c")] == fromList [(5,"c"), (3,"b")] fromList [(5,"c"), (3,"b"), (5, "a")] == fromList [(5,"a"), (3,"b")]
fromList [] == empty fromList [(5,"a"), (3,"b"), (5, "c")] == fromList [(5,"c"), (3,"b")] fromList [(5,"c"), (3,"b"), (5, "a")] == fromList [(5,"a"), (3,"b")]
>>> fromList [("a", 'x'), ("a", 'y')] fromList [("a",'y')]
>>> fromList [1,2] BD 1 [1] 1 [2]
fromList [] == empty fromList [(5,"a"), (3,"b"), (5, "c")] == fromList [(5,"c"), (3,"b")] fromList [(5,"c"), (3,"b"), (5, "a")] == fromList [(5,"a"), (3,"b")]
toList . fromList = id fromList . toList = idThis function is implemented with ++. Repeated uses of fromList are just as inefficient as repeated uses of ++. If you find yourself doing some form of the following (possibly indirectly), you may not be taking advantage of the DList representation and library:
fromList . f . toListMore likely, you will convert from a list, perform some operation on the DList, and convert back to a list:
toList . g . fromList
fromList xs = fromNonEmpty (fromList xs)