Back to Type Challenges

README

questions/25170-medium-replace-first/README.md

latest1.1 KB
Original Source
<!--info-header-start--><h1>Replace First </h1><blockquote><p>by George Flinn <a href="https://github.com/ProjectFlinn" target="_blank">@ProjectFlinn</a></p></blockquote><p><a href="https://tsch.js.org/25170/play" target="_blank"></a> </p><!--info-header-end-->

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.

<!--info-footer-start-->

<a href="../../README.md" target="_blank"></a> <a href="https://tsch.js.org/25170/answer" target="_blank"></a> <a href="https://tsch.js.org/25170/solutions" target="_blank"></a> <!--info-footer-end-->