Zippers for non-inductive types
danghica.blogspot.com
danghica.blogspot.com
But this is wrong. The number of sets over A={0,1,2} is 2^3 = 8 /= e^3
The actual series should be
Set(A) = ∑n (A*(A-1)*(A-2)..(A-n+1))/n! = 2^A
This is also consistent with the fact that Set(A) ~ A -> BoolWhat does "log(2)" mean as a type here? Do you expand it back out as a taylor series like in the circular list example?
M(x) = ∑n (A*(A+1)*(A+2)..(A+n-1))/n!
since there are (n+k+1)c(k+1) possible unordered n-tuples over a set with cardinality k.The division here can be seen as an action of the permutation group (which has n! element).