Open redbaron opened 1 year ago
Added apply*_args_at
variants
Not everyting is known at compile time. In my experiments I have a "query plan" (list of operations) in the HList and need to execute them in order when right conditions arise, hence the runtime n
param to pick one to run.
It adds
applyl_at
andapplyr_at
functions which apply single argument function to then
th HList element. It is implemented as a fold function which carries target and current depth levels as well as function application result in the accumulator.Because
n
can be outside of the hlist length, function returnsOption<_>
withNone
returned ifn
is larger than list size.It also has
apply*_args_at
variants which addsargs
param to the accumulator to be passed to the function as a poor replacement for missingself
(and therefore closure) param.This is a draft PR to collect early feedback, more specifically:
HCons
?