Implement the type ReplaceFirst<T, S, R> which will replace the first occurrence of S in a tuple T with R. If no such S exists in T, the result should be T.
ReplaceFirst<T, S, R>
S
T
R
For example:
ReplaceFirst<[1, 2, 3], 3, 4> // Expected: [1, 2, 4]
Code