Val types exist for their flexibility -- which is a powerful addition, when needed. In some sense, Val types run around the usual category-focused manner and behavior for Types and in that documentation, the key phrase is "consistency across Julia." That is consistency in the use of Val types, and so their internal workings.
With the more usually encountered sorts of type, it is the other way, instances preferred. On Friday, March 11, 2016 at 7:15:13 AM UTC-5, Kristoffer Carlsson wrote: > > On the other hand, the docs for "Val" says otherwise: > > http://docs.julialang.org/en/release-0.4/manual/types/#value-types > > "For consistency across Julia, the call site should always pass a Val type > rather than creating an instance, i.e., use foo(Val{:bar}) rather than > foo(Val{:bar}())." > >
