Make function's behavior depens on type parameters in typescript

Viewed 90

It's like typeclass in functional style.

Scala example:

def f[T](implicit t: SomeTrait[T]): SomeTrait[T] = t

There is only a type parameter T, and the returned data t depends on it.

Can I do something similar in Typescript ?

1 Answers
Related