Unpacking tuple types in Scala

Posted by jpalecek on Stack Overflow See other posts from Stack Overflow or by jpalecek
Published on 2009-02-23T00:00:41Z Indexed on 2010/05/15 21:44 UTC
Read the original article Hit count: 302

Filed under:
|
|
|

I was just wondering, can I decompose a tuple type into its components' types in Scala?

I mean, something like this

trait Container {
  type Element
}

trait AssociativeContainer extends Container {
  type Element <: (Unit, Unit)
  def get(x : Element#First) : Element#Second
}

© Stack Overflow or respective owner

Related posts about scala

Related posts about tuple