Tested Hegel JS on its own website today, looks increasingly promising as a TypeScript alternative. Was worried that JSDoc types don't work, but that ML-inspired type inference is great!

hegel.js.org/try
1
0
2
Replying to @Ceige_M
An example of Hegel's deeper inference. It knows getName returns the name property, and it knows the argument of trim must have a trim() method (a -> b), so in this nested "trim ∘ getName" example, an object with a string name works, but an object with a null name doesn't.

Jan 13, 2022 · 7:57 AM UTC

1
0
0
Replying to @Ceige_M
Unfortunately taking 2 args (a, b) and spreading them into a single object doesn't work; perhaps for security reasons this is a good thing 😅
0
0
0
RepliesRelevant