Skip to content

Instantly share code, notes, and snippets.

@splittingfield
Created December 6, 2011 19:01
Show Gist options
  • Save splittingfield/1439440 to your computer and use it in GitHub Desktop.
Save splittingfield/1439440 to your computer and use it in GitHub Desktop.
Opinions on workaround
class Blah [@specialized (Int) T:Manifest](a:Array[T]) {
def map[@specialized (Int) S>:T, @specialized (Int) W:Manifest](f:S=>W):Blah[W] = {
var i = 0
val newA = new Array[W](a.length)
while (i < a.length) {
newA(i) = f(a(i))
i = i+1
}
new Blah(newA)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment