realworldocaml / book

V2 of Real World OCaml
https://dev.realworldocaml.org
Other
1.19k stars 174 forks source link

New comment on block [block-idp8639168] #1489

Closed xclerc closed 11 years ago

xclerc commented 11 years ago

it may be stated that arrays are invariant

bactrian commented 11 years ago

This comment references this from milestone beta1: http://www.realworldocaml.org/beta1/en/html/imperative-programming-1.html#idp8639168

Context:

OCaml supports a number of array-like data structures; i.e., mutable integer-indexed containers that provide constant-time access to their elements. We'll discuss several of them below.
yminsky commented 11 years ago

Doesn't seem like the right place. Any mutable cell is invariant, after all, and it seems better to get a clear theory then to pepper the world with little examples.

Not that we do that. Variance and covariance is a tricky topic to explain properly, and it is mostly covered in the objects section, really.