(no title)
Ciantic | 4 months ago
const greeting = pipe('hello')
| upper
| ex('!!!')
await greeting.run() // → "HELLO!!!"
If you look at the tests file, it needs to be written like this to make it work: let greeting;
(greeting = pipe('hello')) | upper | ex('!!!');
await greeting.run();
Which is not anymore as ergonomic.
md224|4 months ago
dymk|4 months ago
It means having to go to the linked docs (which are automatically pushed to the repo's github pages) to see examples, but I think this is a reasonable tradeoff.
urvader|4 months ago
unknown|4 months ago
[deleted]
nticompass|4 months ago
hinkley|4 months ago
Mutating your inputs is not functional programming. And pipes are effectively compact list comprehensions. Comprehensions without FP is Frankensteinian.
urvader|4 months ago
byteknight|4 months ago
https://github.com/IAmStoxe/PyNQ
unknown|4 months ago
[deleted]
hinkley|4 months ago
You’ve implied what I’ll state clearly:
Pipes are for composing transformations, one per line, so that reading comprehension doesn’t nosedive too fast with accumulation of subsequent operations.
Chaining on the same line is shit for readying and worst for git merges and PR reviews.