Why sets are implemented as a functor is explained
here
.