Skip to content

Instantly share code, notes, and snippets.

@zah
Created August 29, 2011 19:00
Show Gist options
  • Save zah/1179124 to your computer and use it in GitHub Desktop.
Save zah/1179124 to your computer and use it in GitHub Desktop.
proc myTypeMapper(x: int) : MegaInt
proc myTypeMapper(x: float) : SmartFloat
proc MappedTupleType[T, U](tp: tuple[T, U]) : tuple[
type(myTypeMapper (valueOf[T]())),
type(myTypeMapper (valueOf[U]())),
]
proc MappedTupleType[T](tp: tuple[T]) : tuple[
type(myTypeMapper (valueOf[T]()))
]
var transformedTuple : type(MappedTupleType[tuple[int, float]])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment