File: t7226.scala

package info (click to toggle)
scala 2.11.12-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 62,924 kB
  • sloc: javascript: 28,808; java: 13,415; xml: 3,135; sh: 1,620; python: 756; makefile: 38; awk: 36; ansic: 6
file content (26 lines) | stat: -rw-r--r-- 600 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
trait HK {
  type Rep[X]

  // okay
  def unzip2[A, B](ps: Rep[List[(A, B)]])
  unzip2(null.asInstanceOf[Rep[List[(Int, String)]]])

  // okay
  def unzipHK[A, B, C[_]](ps: Rep[C[(A, B)]])
  unzipHK(null.asInstanceOf[Rep[List[(Int, String)]]])

  def unzipHKRet0[A, C[_]](ps: C[A]): C[Int]
  def ls: List[String]
  unzipHKRet0(ls)

  // fail
  def unzipHKRet[A, C[_]](ps: Rep[C[A]]): Rep[C[Int]]
  def rls: Rep[List[String]]
  unzipHKRet(rls)
}

trait HK1 {
  type Rep[A]
  def unzip1[A, B, C[_]](ps: Rep[C[(A, B)]]): (Rep[C[A]], Rep[C[B]])
  def doUnzip1[A, B](ps: Rep[List[(A, B)]]) = unzip1(ps)
}