I hereby claim:
- I am tmu on github.
- I am tmu (https://keybase.io/tmu) on keybase.
- I have a public key ASBh_n52Q2_-Boszc2JW29F091gntcQolSdSJJAs5fNkVQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
// Run with | |
// xcrun swift -O 028-reduce-over-extensible-collection.swift | |
func deleteDuplicates<S:ExtensibleCollectionType where S.Generator.Element: Comparable>(seq:S)-> S { | |
let s = reduce(seq, S()){ | |
ac, x in contains(ac,x) ? ac : ac + [x] | |
} | |
return s | |
} |