Hacker News new | ask | show | jobs
by Darmani 2407 days ago
Indeed, maps and sets cannot be constructed from sums, products and recursion. They can be approximated if you throw exponentials in there.

Instead, you can extend algebraic data types to combinatorial species, which do allow exactly the kind of quotienting you speak of. While they're unexplored in programming, they are believed to be programmable similarly to ADTs.

https://repository.upenn.edu/cgi/viewcontent.cgi?article=177...

I must take issue with the "objects are products" characterization you implied. Structures are products; objects need existential types: http://www.cis.upenn.edu/~bcpierce/papers/compobj.ps

2 comments

Yeah, I hesitated there. But at the same time, many JavaScript objects are just named tuples. That intuition is ok.
You can encode them as finger trees no? Which are algebraic