g | x | w | all
Bytes Lang Time Link
126Microsoft Excel241031T170030ZGeneral
063Arturo240919T091022Zchunes
073Clojure240918T223743ZMartin P
048C clang240820T142313Zjdt
053R240820T164247ZDominic
046R240820T125629ZKirill L
078tinylisp 2240406T043201ZDLosc
020Haskell + hgl240404T183008ZWheat Wi
055R240405T131932ZGiuseppe
044Ruby240405T073930ZG B
036Wolfram Language Mathematica240404T041246Zatt
040Haskell240404T062929Ztotallyh
065PowerShell Core240404T032434ZJulian
016Pip x240404T183836ZDLosc
069R240404T070154Zpajonk
00805AB1E240404T065237ZKevin Cr
7625Vyxal Wr240403T225235Zlyxal
055Python 3.8240403T210710ZJonathan
046JavaScript Node.js240403T203633Zl4m2

Microsoft Excel, 126

LAMBDA(f,l,LET(i,INDEX(l,1),VSTACK(i,SCAN(i,SEQUENCE(COUNT(l)-1),LAMBDA(s,j,INDEX(f,MOD(j-1,COUNTA(f))+1)(s,INDEX(l,j+1)))))))

Ungolfed with usage example:

=LET(
 tieScan,LAMBDA(f,l,
  LET(
   i,INDEX(l,1),
   VSTACK(i,
    SCAN(i,SEQUENCE(COUNT(l)-1),LAMBDA(s,j,
     INDEX(f,MOD(j-1,COUNTA(f))+1)(s,INDEX(l,j+1))
    ))
   )
  )
 ),
 tieScan(HSTACK(LAMBDA(a,b,a*b),LAMBDA(a,b,a+b)),{9;2;8;6;3})
)

Hooray for built-in SCAN.

Arturo, 68 63 bytes

$[a,b][i:0map b'c[h:<=?i=0->c->call a\[%-i,1size a]@[h,c]'i+1]]

Try it!

If you told me this problem was specifically designed to stymie Arturo, I would believe you.

Clojure, 73 bytes

#(let[i(atom -1)](reductions(fn[a v]((nth(cycle %)(swap! i inc))a v))%2))

Example:

(#(let[i(atom -1)](reductions(fn[a v]((nth(cycle %)(swap! i inc))a v))%2))
  [+, *, -, /]
  [1, 2, 3, 4, 5, 6, 7, 4, 9, 10])
=> (1 3 9 5 1 7 49 45 5 15)

C (clang), 48 bytes

i;q((**p)(),c,*v,n){for(i=0;i<n;p[i%c](i+++v));}

Try it online!

R, 53 bytes

\(L,v,M=0)Reduce(\(...)el(M<<-c(M,L)[-1])(...),v,,,T)

Attempt This Online!

An approach in R based on actually implementing the Jelly tie function:

tie={M=0;\(L)el(M<<-c(M[-1],L))}

Calling tie(L) returns a function that cycles through L each time it's called.
So we can use this as an argument to R's standard scan-like function, Reduce(...,accumulate=TRUE) , similarly to Giuseppe's answer:

f=\(v,L)Reduce(\(...)tie(L)(...),v,,,T)

Attempt This Online!

Incorporating the code for tie directly into the Reduce call golfs this down to 53 bytes: this is sadly still longer than Kirill L's answer using a different approach, but pleasingly competitive with those of Giuseppe & pajonk.

R, 46 bytes

\(L,v)c(a<-v[1],Map(\(x,y)a<<-x(a,y),L,v[-1]))

Attempt This Online!

Building up on pajonk's and Giuseppe's answers, I find it shorter to Map over the lists of functions and values, maintaining an additional accumulator, rather than to force the actual Reduce to do what we need.

Note that Map formats the output as a list. It's +3 bytes to change to mapply, which would preserve the more readable vector output: Attempt This Online!

tinylisp 2, 78 bytes

(d G(\(A D N)(c A(? N(G((h D)A(h N))(,(t D)(] 1 D))(t N))(
(\(D N)(G(h N)D(t N

The first line defines a helper function G; the second line is an anonymous function that performs the task. Try It Online!

Explanation

First, the main function:

(\(D N)(G(h N)D(t N)))
(\                   ) ; Lambda function
  (D N)                ; that takes two args, D (list of Dyads) and N (list of Numbers):
       (G           )  ;  Call G with the following arguments:
         (h N)         ;   Head of N
              D        ;   D
               (t N)   ;   Tail of N

The recursive helper function does the actual work:

(d G(\(A D N)(c A(? N ... ()))))
(d G                           ) ; Define G to be
    (\                        )  ; a lambda function
      (A D N)                    ; that takes an accumulator A, plus D & N as before:
             (c A            )   ;  Cons A to...
                 (? N       )    ;   If N is not empty,
                      ...        ;   recursive call (see below)
                          ()     ;   else, nil

(G((h D)A(h N))(,(t D)(] 1 D))(t N))
(G                                 ) ; Call G recursively on these args:
  ((h D)      )                      ;  New accumulator value: call first function in D
        A                            ;   on the old accumulator
         (h N)                       ;   and the first number in N
               (,            )       ;  New list of dyads: concatenate
                 (t D)               ;   the tail of D
                      (] 1 D)        ;   with a list of the first 1 elements of D
                              (t N)  ;  New list of numbers: tail of N

tinylisp, 84 bytes

(d G(q((A D N P)(c A(i N(G((h P)A(h N))D(t N)(i(t P)(t P)D))(
(q((D N)(G(h N)D(t N)D

Try it online!

Works similarly, but we avoid expensive library functions like concat by using a fourth argument, P, a partial list of dyads. Whenever P becomes empty, we refill it from D.

Haskell + hgl, 20 bytes

cr<<<lz(m<U id)<<zcz

Attempt This Online!

Explanation

In regular haskell this would be

map snd ... foldl1 (fmap . uncurry id) ... zip . cycle

Where (...) is the blackbird combinator.

Reflection

I'm quite happy with this. It's nice to see zcz getting used, especially because that's an operation I ported over from Jelly in the first place.

m<U id seems like it might be too long, but it's a very niche operation.

That's all I have for local optimizations of this. However, the overall operation appears to be useful.

R, 56 55 bytes

\(L,v)Reduce(\(x,y){L<<-c(L[-1],`?`<-el(L));x?y},v,,,T)

Attempt This Online!

Test harness borrowed from pajonk's answer; -1 byte thanks to pajonk.

A rare instance of golfing with the <<- operator, which in this case causes L to be re-defined in the parent environment; this is a few bytes more succinct than using a for loop and manually cycling through both lists.

Ruby, 47 44 bytes

->o,l{k=1;l.map{|x|l=l*0!=0?x:o[k^=1][l,x]}}

Try it online!

Wolfram Language (Mathematica), 39 36 bytes

-1 from totallyhuman

FoldList[h=#;Last[h=##2|#&@@h]@##&]&

Try it online!

Input [funcs][list].

Reusing f[funcs] resumes the cycle wherever the last call left off, as should be expected. However, calling f anew invalidates all previous f[funcs]s. We could fix that by uncurrying for +3 bytes: Try it online!

         h=#;Last[h=##2|#&@@h]@##&  tie (each call: rotate left and call the last function)
FoldList[                         ] scan

Haskell, 40 bytes

(f:g)#(l:m:n)=l:(g++[f])#(f l m:n)
_#l=l

Try it online!

More functional approach, 51 46 bytes

f#(h:t)=scanl(flip id)h$zipWith flip(cycle f)t

Try it online!

Even more functional approach, 46 bytes

((map snd.scanl1(fmap.uncurry id)).).zip.cycle

Try it online!

Cool fmap usage brought to you by Wheat Wizard.

PowerShell Core, 65 bytes

param($n,$o)$n|%{if($p){$p=&$o[$i++%$o.count]$p $_}else{$p=$_}$p}

Try it online!

Pip -x, 16 bytes

FibYPy?(a@Uvyi)i

Takes the list of functions and the list of integers as command-line arguments. Attempt This Online!

Explanation

FibYPy?(a@Uvyi)i
                  ; y is ""; v is -1 (implicit)
                  ; Eval both command-line args as Pip objects (-x flag)
Fi                ; For each integer i
  b               ; in the second argument (list of ints):
     y?           ;  Is y truthy?
                  ;  If so (all iterations after the first):
          Uv      ;   Increment v
        a@        ;   Use it to index cyclically into first argument (list of funcs)
       (    yi)   ;   Call that function on the arguments y and i
                  ;  If not (first iteration):
               i  ;   Use i unchanged
   YP             ;  Print that value and yank it into y for the next iteration

R, 69 bytes

\(L,v,k=v[1])for(i in c(v[-1],1))k=L[[F<-F%%length(L)+1]](print(k),i)

Attempt This Online!

05AB1E, 8 bytes

(could have been 7 bytes, but there is a bug in the cumulative reduce-by builtins)

Å»I¾è.V¼

05AB1E lacks functions, but it can evaluate strings to mimic the behavior of functions.
First input is the list of integers; second it the list of function-strings.

Try it online or verify all test cases.

Explanation:

Å»        # Cumulative left-reduce the first (implicit) input-list of integers:
  I       #  Push the second input-list of function-strings
   ¾è     #  Pop and leave the (0-based modular) `¾`'th function-string
          #  (`¾` is 0 by default)
     .V   #  Evaluate it as 05AB1E code
       ¼  #  Increase `¾` by 1
          # (after which the resulting list is output implicitly)

Vyxal Wr, 61 bitsv2, 7.625 bytes

¨Sḣ(:n?†

Try it Online!

Bitstring:

0011000000110111100101111100011001011110101000100101000001110

Expects the numbers, then the functions on the stack.

Explained

¨Sḣ(:n?†­⁡​‎‎⁡⁠⁡‏⁠‎⁡⁠⁢‏‏​⁡⁠⁡‌⁢​‎‎⁡⁠⁣‏‏​⁡⁠⁡‌⁣​‎‎⁡⁠⁤‏‏​⁡⁠⁡‌⁤​‎‎⁡⁠⁢⁡‏‏​⁡⁠⁡‌⁢⁡​‎‎⁡⁠⁢⁢‏‏​⁡⁠⁡‌⁢⁢​‎‎⁡⁠⁢⁣‏‏​⁡⁠⁡‌⁢⁣​‎‎⁡⁠⁢⁤‏‏​⁡⁠⁡‌⁢⁤​‎‏​⁢⁠⁡‌­
¨S        # ‎⁡Set the input source to the list of functions
  ḣ       # ‎⁢Push the head of the numbers list and then the rest
   (      # ‎⁣For each number in the rest:
    :     # ‎⁤  Duplicate the top of the stack
     n    # ‎⁢⁡  Push the number
      ?   # ‎⁢⁢  Get the next function (cyclical input)
       †  # ‎⁢⁣  Call the function. The r flag swaps the arguments before executing
# ‎⁢⁤The W flag wraps the stack before printing
💎

Created with the help of Luminespire.

Python 3.8, 55 bytes

lambda o,x,*v:[x]+[x:=a(x,n)for a,n in zip(o*len(v),v)]

An unnamed function that accepts a list of functions and some values and returns the cumulative list.

Try it online!

JavaScript (Node.js), 46 bytes

a=>b=>b.map((c,i)=>h=i--?a[i%a.length](h,c):c)

Try it online!