Loading ...
Sorry, an error occurred while loading the content.
 

Variance of arrays

Expand Messages
  • Lukasz Stafiniak
    Hi, Why oh why are arrays invariant, while lists are nicely covariant?
    Message 1 of 3 , Oct 5, 2010
      Hi,

      Why oh why are arrays invariant, while lists are nicely covariant?
    • Lukasz Stafiniak
      ... I see, arrays are mutable... so they could get element types mixed-up post-initiation otherwise.
      Message 2 of 3 , Oct 5, 2010
        On Tue, Oct 5, 2010 at 1:55 PM, Lukasz Stafiniak <lukstafi@...> wrote:
        >
        > Why oh why are arrays invariant, while lists are nicely covariant?

        I see, arrays are mutable... so they could get element types mixed-up
        post-initiation otherwise.
      • Lukasz Stafiniak
        Is there a widely used immutable array library? I m interested in arbitrary-size tuples without update (for updatable immutable arrays I would just use maps),
        Message 3 of 3 , Oct 5, 2010
          Is there a widely used immutable array library? I'm interested in
          arbitrary-size tuples without update (for updatable immutable arrays I
          would just use maps), but with mapping, folding, patterns and access
          syntax.

          On Tue, Oct 5, 2010 at 2:00 PM, Lukasz Stafiniak <lukstafi@...> wrote:
          > On Tue, Oct 5, 2010 at 1:55 PM, Lukasz Stafiniak <lukstafi@...> wrote:
          >>
          >> Why oh why are arrays invariant, while lists are nicely covariant?
        Your message has been successfully submitted and would be delivered to recipients shortly.