jello icon indicating copy to clipboard operation
jello copied to clipboard

FEATURE: Lazy algorithms

Open tom-huntington opened this issue 1 year ago • 0 comments

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 (like take_while but doesn't drop the terminating element)
  • more flavours of iterate that take functions a -> [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.

tom-huntington avatar Mar 03 '24 08:03 tom-huntington