Menu

Post image 1
Post image 2
1 / 2
0

Aljabr (الجبر): 0-deps TypeScript lib that fuses tagged unions / exhaustive matching + schema validation + reactive state + reactive UI

DEV Community·Ja·26 days ago
#YAYMCq3K
Reading 0:00
15s threshold

I’ve been working on this for a little over a month, wrote a couple of articles and tried to share it around without much luck so I figured I’d try again. I just released v0.3.10, which I’m treating as the first stable release. No further breaking changes are planned for the API surface so now is a good time to take a look. Aljabr is a zero-dependency TypeScript library that treats tagged unions (algebraic data types) as the central primitive. You define a union once and get exhaustive pattern matching, schema validation, and reactive state management all from that single definition. The problem it solves is the fragmentation that happens when domain models, validation, and reactivity are handled by separate libraries. By unifying everything around unions, it makes application state behave like a compiler-checked finite state machine and eliminates whole categories of impossible-state bugs.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More