Seeking Pattern Matching Solution for Union Type in TypeScript - Effect Community