Syntactic sugar for specifying tuple function arguments


#1

Instead of

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

it would be nice to say:

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

or even better:

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

#2

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.


#3

https://github.com/JuliaLang/julia/issues/6614


#4

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


#5

I think this would be useful.


#6

Definitely useful, mostly a matter of someone implementing it.