Oh, I get that their example said _alternating_ function and regex. If that's the real requirement then they shouldn't be _alternating_ in the list at all, there should be a list of (function, regex) tuples. We don't need an example of tuples, they're even more widespread than sum types / unions / enums.
So the design as stated is very contrived, to the point where it doesn't make sense, but existing constructs can be used to make sense of it with a change one way or the other.
So the design as stated is very contrived, to the point where it doesn't make sense, but existing constructs can be used to make sense of it with a change one way or the other.