GoldingAustin / pattern-matched

Pattern matching library for JavaScript and Typescript
MIT License
1 stars 0 forks source link

Project status #1

Closed kee-oth closed 2 years ago

kee-oth commented 2 years ago

Hi!

I just randomly happened to run into this project through the SolidJS grapevine. It's very timely since I was just looking for a pattern matching library to use. Does this project intend to be supported/continued in any way or is it just a small side-project without intent for 3rd party usage?

Thanks!

GoldingAustin commented 2 years ago

I originally intended to support this further. However, I discovered ts-pattern after my initial efforts. ts-pattern fulfills all the goals I originally had for this library and more. I would highly recommended using it!

kee-oth commented 2 years ago

Thanks for the quick reply!

I don't use Typescript because of its various limitation regarding functional programming but thank you for pointing that library out! The search continues!

Thanks!

GoldingAustin commented 2 years ago

ts-pattern is usable without TypeScript! It still gives you all the pattern matching functionality, it just doesn't give you some of the type hints you would get with TypeScript.

TypeScript is just a superset of JavaScript, so you can write all the same functional code you would with JavaScript but with optional type checking.

Either way, you can still use ts-pattern in a JavaScript only environment!

kee-oth commented 2 years ago

@GoldingAustin

Thanks for the info! I'll look back into ts-pattern.

And yeah, TypeScript just makes functional programming really clunky. You can do stuff but it's difficult (last I checked). Types can end up being super complicated with overloads for compose and pipe functions, higher order function concepts like monads, etc.