jello
jello copied to clipboard
FEATURE: Lazy algorithms
For advent of code 2023, I did each part in a single expression, using infix binary operators, hacking the language's builtins as I did the problems.
My key insight was that to get an elegant solution you need these algorithms:
- lazy
scan -
iterate(inherently lazy) -
take_while -
stop_after(liketake_whilebut doesn't drop the terminating element) - more flavours of
iteratethat take functionsa -> [a]
I think these algorithms expand the problems array languages are adept at solving. They encapsulate control flow.
Perhaps, if you post some "cute" problems you currently cant solve in array languages, but want to, I'll try to devise something.
story
I was trying to devise some syntax to do more advanced chaining than my noulith fork allows, when I stumbled across your Jello stream and you said no ambivalence, I knew this is what I was looking for (it's essential to enable advanced chaining/treeing).Being able to write dyads point free was what I needed.
Point free advent of code 2024.