Parameterized Functions
Example:
def bisect<T>(a: [T], x: T) -> int:decl lo, mid, hi: intlo, hi = 0, len(a)while lo < hi: mid = (lo+hi)/2 if x < a[mid]: hi = mid else: lo = mid+1return lo
decl a: [int]
Idea:
- bisect() could be called without template instantiation
- argument types will be matched against the type parameters <T>