Skip to content

Instantly share code, notes, and snippets.

@WimJongeneel
Created December 15, 2019 11:00
Show Gist options
  • Save WimJongeneel/a1033b96ef62d2973d5be6c59ea0134f to your computer and use it in GitHub Desktop.
Save WimJongeneel/a1033b96ef62d2973d5be6c59ea0134f to your computer and use it in GitHub Desktop.
with: <p extends Pattern<a>>(
pattern: p,
expr: (a: Extract<a, typeof pattern>) => b
) => match(value, otherwise, [...patterns, [pattern, expr]])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment