Syntactic sugar for specifying tuple function arguments


Instead of

   function f(t::Tuple{Bool,Int})
      a = t[1]
      b = t[2]

it would be nice to say:

  function f((a,b)::Tuple{Bool,Int})

or even better:

  function f((a::Bool, b::Int))


Looks like you want ML-style pattern matching. Not sure whether most people are interested in this, but I’d support a PR that implements it.



It does seem useful from time to time. I wonder why python3 gets rid of it.


I think this would be useful.


Definitely useful, mostly a matter of someone implementing it.