3 ms·
I find straight forward, dedicated, precisely typed combinators much more readable and practical to use ie. for iterables (context where it makes a lot of sense
by mirekrusin 3y ago
I find straight forward, dedicated, precisely typed combinators much more readable and practical to use ie. for iterables (context where it makes a lot of sense) [0] example [1], runtime assertions (through refutations, which are much faster than combinators over assertions) [2], parser combinators for smallish grammars [3] etc.
In many cases vanilla/imperative js is more readable and terse, no need to bring functional fanaticism everywhere, just in places where it gives true benefits and in form that can be understood by peers.
Functional code can be beautiful and can also be unreadable/undebugable. Same with imperative code. It's great in js/ts you can pick approach where the problem is expressed more naturally and mix those paradigms at will.
[0] https://github.com/preludejs/generator https://github.com/preludejs/generator
[1] https://observablehq.com/@mirek/project-euler https://observablehq.com/@mirek/project-euler
[2] https://github.com/preludejs/refute https://github.com/preludejs/refute
[3] https://github.com/preludejs/parser https://github.com/preludejs/parser