Lists

Products are what a Python programmer might call a tuple, a list of a fixed length. Let c be a contract; a list of c‘s of arbitrary length (well, up to length 231 – 1) is the contract

arrOf(c) ≅ makeCoproduct([
  makeProduct([]),
  makeProduct([c]),
  makeProduct([c, c]),
  makeProduct([c, c, c]),
  ...,
  makeProduct([c, ..., c]) // (1 << 31) - 1 copies
]);

That is, it’s either an empty list, or a one-item list, or a two-item list, and so on up to a (231 – 1)-item list. The length member of the array says which of these it is.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: