, unionAllBy, , , compare Ord . Ord, unionAll unionAllBy.
unionAllBy :: (a -> a -> Ordering) -> [[a]] -> [a]
unionAll :: Ord a => [[a]] -> [a]
compare :: Ord a => a -> a -> Ordering
unionAll = unionAllBy compare
, : LT, EQ GT. , compare, , Ord
compare x y
| x == y = EQ
| x <= y = LT
| otherwise = GT
x <= y = compare x y /= GT
x < y = compare x y == LT
x >= y = compare x y /= LT
x > y = compare x y == GT
unionAll sequence2, . unionAll , .
> unionAll $ sequence2 [2,4,5] [3,4,5]
[6,8,10,12,15,16,20,25]
^
only one twenty
sequence2
> take 12 . unionAll $ sequence2 [2,4..] [3,5..]
[6,10,12,14,18,20,22,24,26,28,30,34]
, mergeAll.
> mergeAll $ sequence2 [2,4,5] [3,4,5]
[6,8,10,12,15,16,20,20,25]
^ ^
two twenties