`Pair{A,B}` vs. `Tuple{A,B}`

I don’t think that (lack of) covariance motivated the implementation of Dict, Pair is simply convenient with the => syntax. In any case, note that internally Dict does not use Pair, it is just for construction.

Pair is generally used in contexts where you need to store a pair of objects that belong together.

I would mostly use Pair to signify intent, and for dispatch. Eg the Dict(::Pair...) constructor is different from the fallback Dict(itr).

1 Like