changeset 19770 | be5c23ebe1eb |
parent 19564 | d3e2f532459a |
child 19841 | f2fa72c13186 |
19769:c40ce2de2020 | 19770:be5c23ebe1eb |
---|---|
60 |
60 |
61 (* forms all "unordered pairs": [1, 2, 3] ==> [(1, 1), (1, 2), (1, 3), (2, 2), (2, 3), (3, 3)] *) |
61 (* forms all "unordered pairs": [1, 2, 3] ==> [(1, 1), (1, 2), (1, 3), (2, 2), (2, 3), (3, 3)] *) |
62 fun upairs [] = [] |
62 fun upairs [] = [] |
63 | upairs (x::xs) = map (pair x) (x::xs) @ upairs xs |
63 | upairs (x::xs) = map (pair x) (x::xs) @ upairs xs |
64 |
64 |
65 |
|
66 fun the_single [x] = x |
|
67 | the_single _ = sys_error "the_single" |