Generates a map using a Range to determine the length.
This may fail to generate anything if the keys produced by thegenerator do not account for a large enough number of uniqueitems to satify the required map size.
map f s is the set obtained by applying
f to each element of s.
It's worth noting that the size of the result may be smaller if, for
some (x,y), x /= y && f x == f y