top | item 39758779

(no title)

ismaelct | 1 year ago

I tried to keep this as idiomatic to Ruby as possible. No meta-programming, no FP machinery like monads, etc. Little more to it than an array of objects and a reduce function. All plain Ruby in my book.

I wonder if just using "throw :halt" (like in AR callbacks, to halt callback chains) or an Enumerator with "raise StopIteration" (which would work) would throw people off a bit less, just on account of those things being more familiar.

discuss

order

corytheboyd|1 year ago

Eh, don’t let myself or others influence your library. You will know what’s best, and hacker news will mostly elicit lots of nitpicky reasons as to why you are wrong.

ismaelct|1 year ago

To be clear this is not a library. I'm just describing a pattern and a bare-bones implementation.