Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: