The whole history can be reconstructed from various discussions linked here. I haven’t read everything, but this explanation is a good one-stop.
Let me quote an excerpt from Stefan’s explanation:
In Julia 1.0, on the other hand, type parameters and constructors will be thoroughly consistent, following these general principles uniformly:
- The syntax used to define a method always matches the syntax used to call it.
- The
F{T}
syntax always refers to the typeF
with parameter valueT
.- Type parameters are always introduced by
where
clauses.I think these principles make the syntax and semantics of parametric types and methods far more understandable and intuitive. Given these principles, semantics like what we now have seem inevitable. The only real question is syntax – and what syntax to use was one of the biggest bikesheds around this issue. I wasn’t initially thrilled with the postfix
where
syntax, but it’s grown on me and now it seems quite natural. The only really odd case, as you mention, isf(...) where T = body
without any type bound, but I’ve found that even this case fairly quickly loses its unfamiliarity. Other keywords thanwhere
were discussed, includingforall
and∀
. However, Julia’s “union all” types are not universally quantified types (they’re actually closer to existentially quantified types), so both of these choices would have been actively at odds with existing type theory nomenclature. Thewhere
keyword was the most evocative choice proposed that didn’t clash with well-established terminology. Finally, having thewhere
clause on the right just seemed to read much more naturally in the vast majority of usages.