[Question]
  [
Think of cleave as the conceptual inverse of map. If map applies a function to each number in a list...
`map([1, 2, 3], x -> x * 5)` -> `[5, 10, 15]`
then cleave applies each function in a list to a number.
`cleave(5, [x -> x * 2, x -> x - 1, x -> x * x])` -> `[10, 4, 25]`
More formally, given:
* \$n\$, an integer, and
* \$L\$, a list of [black box functions](https://codegolf.meta.stackexchange.com/questions/1324/standard-definitions-of-terms-within-specifications/13706#13706) with type signature `integer -> integer` or equivalent
Apply each function in \$L\$ to \$n\$, collecting the results in a list the same length as \$L\$. (It can be the same list if you want.)
## Challenge
Implement the cleave function in your language of choice.
## Format
You must accept an integer and a list of [black box functions](https://codegolf.meta.stackexchange.com/questions/1324/standard-definitions-of-terms-within-specifications/13706#13706) and output a list of integers in [any reasonable format](https://codegolf.meta.stackexchange.com/questions/2447/default-for-code-golf-input-output-methods). Argument order doesn't matter. The list of functions is flexible. You may accept:
* A list of black box functions (including a list of function pointers, etc.).
* A variable number of black box functions as parameters (varargs).
* A number indicating how many functions to accept.
* Etc.
## Rules
* Builtins are allowed, but please consider adding a less trivial answer so we can see how cleave might be implemented in your language.
* Explaining your answer(s) is encouraged!
* [Standard loopholes](https://codegolf.meta.stackexchange.com/questions/1061/loopholes-that-are-forbidden-by-default) are forbidden.
* This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so the code with the fewest bytes (in each language) wins.
## Test cases
Note: for simplicity, instead of showing functions like `x -> 10 * x`, I will show them like `10x`. Imagine there is an \$f(x) =\$ in front of each of these.
```
  3, [] -> []
 42, [x] -> [42]
  0, [10x, x/2, abs(x), -x] -> [0, 0, 0, 0]
  8, [10x, x/2, abs(x), -x] -> [80, 4, 8, -8]
 -5, [abs(x), -x, x+10] -> [5, 5, 5]
  5, [abs(x), -x, x+10] -> [5, -5, 15]
 10, [x*x, x/10, x*x + 2x + 1, 13, x%3 - 3] -> [100, 1, 121, 13, -2]
950, [x*x, x/10, x*x + 2x + 1, 13, x%3 - 3] -> [902500, 95, 904401, 13, -1]
```
  
[Answer]
# Haskell, 11 bytes
`map.flip($)`
(If using Stack, this can be dropped to 7 bytes: `map.(&)`.)
[Answer]
# [Python 3](https://docs.python.org/3/), 27 bytes
```
lambda L,n:[g(n)for g in L]
```
[Try it online!](https://tio.run/##K6gsycjPM/6fZhvzPycxNyklUcFHJ88qOl0jTzMtv0ghXSEzT8En9n9OsYKtQjRURYWVgqGBVoWOAoJfoa9vhMzPTazQACrQrdBEFtWtiOXKAxpkwVVQlJlXopGmkVOso5CnqfkfAA "Python 3 ‚Äì Try It Online")
Anonymous function that takes the list of functions and a number as arguments.
[Answer]
# JavaScript, 20 bytes
```
a=>n=>a.map(f=>f(n))
```
[Try it online!](https://tio.run/##y0osSyxOLsosKNHNy09J/Z9m@z/R1i7P1i5RLzexQCPN1i5NI09T839yfl5xfk6qXk5@ukaaRnSFgq2dQoWCloKRjgKUratgCGdrKVTEamqYAvUBAA) or [run all test cases](https://tio.run/##rZLBbsMgDIbvewpfJkELiU2IlBySN9gTVDnQrllbtUnVVBNvn0IXpmpUuzTIWJYx/4eBg/k2w@ayP19l139ux7Yau6o2zpKTObO2qlvWcT5u@m7oj9vk2H@xlgFknK0azuG1kaawat7@aGvltC1UNdhXCF5bq0gdMKgTLqyAH1CqpujDXHeJWQ/M8ikjn57Cq6OAyWJKMRulcAAtoBAgi4gj88B5Jhm4S8L/b9JzcgHe4lZmRUg3KYbQ76vYh@siDOHCwhLU3dOUoywsvmcgIfN4DyF0u1wRKe9ckYw@QZnPhytR5Z5YusZK1BoDlZrxBg) (courtesy of Arnauld)
[Answer]
# [Java (OpenJDK 8)](http://openjdk.java.net/), 22 bytes
```
L->x->L.map(a->a.f(x))
```
[Try it online!](https://tio.run/##jVGxTsMwEJ3rr7jRqeIEmFBSLDGAhNRObSfEcE2d1CFxIvtSpUL99uBCqJAqRBf7/N47v2dfiXsUTatMuX0fdN02lqD0WNSRrqJpyi4wR1ZhfaLiGC7YvDMZ6caceKYNKZtjpuB5hGG2CmEt4YNN2m5T6QzWkPMVUJCyI2MjllXoHCxQm19CR0h@2zd6C7Wn@JKsNsXrG6AtXHBSTn5sZsuvkLPz@cUnKZQNYSykDOGSHLvOGumTKNwreBjmQvZCzqMaW45CYpTzPgiG1Jt@azzwaC0eXIRurh1x/rd5ALwHIeH2BqbQByFcoe0hhrv/pAukXZLgxl11pfAvGMfJfZXze7809gmzHV8eHKk6ajpKktb/M1XGj2hyZMfhEw "Java (OpenJDK 8) ‚Äì Try It Online")
-4 bytes thanks to Olivier Gr√©goire
`L` is a stream of `Function<Integer, Integer>` and `x` is an `int`. `Function` here is not `java.util.function.Function` but rather is a custom interface `Function<T, U>` with a single method `U f(T t)`. This is just to save bytes over the normal `Function<T, U>` which requires the method name `apply`, which is apparently allowed.
[Answer]
# [Julia 1.0](http://julialang.org/), 9 bytes
```
a^b=a.|>b
```
[Try it online!](https://tio.run/##yyrNyUw0rPj/PzEuyTZRr8Yu6X9BUWZeSU6ehqlCnEJ0ha5dhZaRjgKI1jWE0FoVsZr/AQ "Julia 1.0 ‚Äì Try It Online")
# Julia 1.6+, 3 bytes
As pointed out by [@MarcMush](https://codegolf.stackexchange.com/users/98541/marcmush), Julia 1.6 has since allowed defining `.|>` as a function, giving this 3-byter:
```
.|>
```
TIO does not offer Julia 1.6, but here's an interactive example:
```
julia> f=.|>
Base.Broadcast.BroadcastFunction(|>)
julia> println(f(5, [x->x*2, x->x-1, x->x*x]))
[10, 4, 25]
```
[Answer]
# [C# (Visual C# Interactive Compiler)](http://www.mono-project.com/docs/about-mono/releases/5.0.0/#csc), 23 bytes
```
a=>b=>b.Select(x=>x(a))
```
C# was born for this
[Try it online!](https://tio.run/##lY4xC8IwEIV3f8XR6SJp1eogtA2IKCh1cnBuQ9RATaFJsSD@9hibwUWhHsfx7nF877gOuZYWtq3iqVSGepVLbdKP5wZjFHYb1d5EU5SVSHuLwdndQAa2yFjpOjqKSnCDXcY6LAixyWi0rpWuKxGdGmlELpVAbRqpLtG@lgoDCgF9U3BOUIk7fItG4ioZQuofwkVMEH7D4AHYEfciPP/jLodhx7Mp9WoSe3EozDValdot3gi7Ptq@AA "C# (Visual C# Interactive Compiler) ‚Äì Try It Online")
[Answer]
# [R](https://www.r-project.org/), 38 bytes
```
function(i,m)sapply(m,do.call,list(i))
```
[Try it online!](https://tio.run/##nZLdioMwEIXvfYqB0kXbyTaJCvWi@yJLIalrQUh/ULfYp3cnpqabshftSpTxMOdzcmIzlKbSl2oz7L@PZVefjnGNh6TV57O5xgf8Or2X2hg0ddvFdZIMM5gaQZtat1UL@1MDXdV2sGuqS91d4Q1KoxuqItUverXx6D6hdxJDKVKCh5LgY9tKho0rGSm9a6lUG1uoSDEyKkZFvxQ87CbBMh7l1Sgv@qWkjsfZlpJuQQOl4TwpWeYpC9V@bqUocgnGKQKMMSUJPHPNgH3A53ayZxKdneJ5huDsmfQAPn1/jBPH@HDKC21SIdYByHVbHrT@F2hNjAyBzGztUSyfNvXbju60/tilQ5HJLk/J/UAvUuznxZ0juI944TZGfrz/DGjPHW8nTVzHEZxsgpa0Dzplds@8yDm@Tiy4zC20oPEKnmV8Aovt8AM "R ‚Äì Try It Online")
[Answer]
# Ruby 2.7, 19 bytes
```
->a,b{b.map{_1[a]}}
```
[Try it online!](https://tio.run/##KypNqvyfZvtf1y5RJ6k6SS83saA63jA6Mba29n@BQlq0qU60rl1FdYWWUW1s7H8A "Ruby ‚Äì Try It Online")
Doesnt work on TIO cause of Numbered arguments.
[Answer]
# [APL (Dyalog Unicode)](https://www.dyalog.com/), 0 bytes
APL doesn't normally use lists of functions, but there are ways to use such. Even if the syntax for their creation is awkward, their use is simple: [Try it online!](https://tio.run/##SyzI0U2pTMzJT//v96htwqO@qX7Bh1aYPurd8qir6VHvGi6/aMNYvTSgVPWj3q2HpwOJWqCYEZLYdkMDkJAxVEgDpk5TQVtBwwjONAQpMoEqMjQG8UxhWoxrwIp0FYDCPkARP720////@ygYGnD5KFiaGgAA "APL (Dyalog Unicode) ‚Äì Try It Online")
For the specific case of a list of integer‚Ü¶integer functions, it is convenient to represent \$L\$ as a [train](https://apl.wiki/train), though it, despite appearances, isn't a list of functions. The calling syntax is identical to the above: [Try it online!](https://tio.run/##SyzI0U2pTMzJT//vY/CobYIOl48hiFKoftS7tZbLxwjIqTY0ODwdxIWIHt5uBGLVQBQY41cApHUhCk1AClHEIKq1DQ2AsqYgWZBeFHOAUkCmBkxcU0FbQcMIzjQESRoag5UY14AFdRWMa///B3pFwRjoEQUTI6ADFQyAliscWm8KooCEqYKhAYi0NDUAAA "APL (Dyalog Unicode) ‚Äì Try It Online")
If we absolutely wanted something that took \$L\$ and \$n\$ and applied \$L\$ to \$n\$ using the above juxtaposition syntax, we write a full program which prompts first for \$\$ and then for \$L\$, applying \$L\$ to \$n\$ by juxtaposition of the input values:
# [APL (Dyalog Unicode)](https://www.dyalog.com/), 2 bytes
```
‚éï‚éï
```
Each stylised console prompts for a value from the console (STDIN).
[Try it online!](https://tio.run/##SyzI0U2pTMzJT//v96htwqO@qX7Bh1aYPurd8qir6VHvGi6/aMNYvTSgVPWj3q2HpwOJWqCYEZLYdkMDkJAxVEgDpk5TQVtBwwjONAQpMoEqMjQG8UxhWoxrwIp0FYDCPkARP700rkcd7QoF/4EOAqL/QM5/BTAo4DI04PLhgnEsTYE8AA "APL (Dyalog Unicode) ‚Äì Try It Online")
Alternatively, we could define an "apply" operator that takes \$L\$ on the left and \$n\$ on the right:
# [APL (Dyalog Unicode)](https://www.dyalog.com/), 5 [bytes](https://github.com/abrudz/SBCS)
```
{‚ç∫‚ç∫‚çµ}
```
`‚ç∫‚ç∫` is the left [operand](https://apl.wiki/operand) and `‚çµ` is the right [argument](https://apl.wiki/argument).
[Try it online!](https://tio.run/##fVC9isJAGOzzFFsqGtmfbGFto7CkuNiJReDQRoitqI2ChRC5Kw5fwUKwUYQrkzfZF4nzZRPR4g7CzmS@mWTni@cz/3MRz5JpEdrdlz38hFF20ja92v3GpmcvHIlxZ4LR0qa3/IhjDU2@aHfBSVKV1Kh9TdZiDfmkgkxBZRKK3nQdUavS5DPIBkrYmXiGg7Q9IwjYsvyxkWWYu3s4Nb9LYitnUP8bgL4zBmR805y7RW2Mfitcfwcj0L8LYohiZHkpVCD7Wz63dZHQjtOD3W@xWyw5u@DC39h69NHDOewPosKwhAnuEXQ1kIMo7AEQSDQEQg0A2UU7AtBVSrvYAw "APL (Dyalog Unicode) ‚Äì Try It Online")
[Answer]
# [Raku](http://raku.org/), 13 bytes
```
{@^f¬ª.($^n)}
```
[Try it online!](https://tio.run/##K0gtyjH7n1upoJamYPu/2iEu7dBuPQ2VuDzN2v/FiZUKaRrRWoc26Sho6Rsa6ChUK6jEH9qkoK1gpKUSD6QMa4FihsZAUktBVcFYQVfBOFZHwdBA8z8A "Perl 6 ‚Äì Try It Online")
[Answer]
# [R](https://www.r-project.org/) >= 4.1, 21 bytes
```
\(l,i)Map(\(x)x(i),l)
```
[Try it online!](https://tio.run/##K/qfZvs/rTQvuSQzP08jRydT0zexQAMuUKFZoZGpqZOj@T9NIyezuARFRkFbwVBHAUUkTsEITURLwVJTR8FE8z8A)
An anonymous function taking a list of functions and an integer and returning a list of integers.
TIO version uses `function` instead of `\` since TIO hasn‚Äôt been upgraded to R 4.1 yet.
[Answer]
# BQN, 7 bytes
```
{ùïéùï©}¬®‚üú<
```
[Try it!](https://mlochbaum.github.io/BQN/try.html#code=Q2xlYXZl4oaQe/CdlY7wnZWpfcKo4p+cPCAKYXJy4oaQLeKAvyvigL8oM+KKuCsp4oC/KOKMiuKImOKImikKYXJyIENsZWF2ZSAz)
-2 bytes from dzaima.
Takes a list of monadic BQN functions, returns a list of the same length.
[Answer]
# [J-uby](https://github.com/cyoce/j-uby), 3 Bytes
```
:-@
```
J-uby actually has a built-in for this, despite me never having actually used it. You are intended to use it with `-[f, g, h]` to create a function that will "cleave" a provided argument over the functions in the array. `:-@` is the symbol for unary minus in Ruby, which is callable in J-uby. It would take input in the form `:[[email protected]](/cdn-cgi/l/email-protection)(L).call(n)`.
But built-ins are boring. How would it be implemented otherwise?
# 13 Bytes
```
~:*%(:& &~:^)
```
There are basically three components to this function. First is `~:*` which just creates a flipped-argument map function: `->(a, f){ a.map(&f) }`.
Next, there is `:& &~:^`. This defines the "n-applicator" function: given the input `n`, this defines a function that will apply `n` to whatever function you pass it. Essentially, it‚Äôs equivalent to `->(n){ ->(f){ f[n] } }`. How does this work? `^` is the function application operator, so `~:^` is function application with flipped arguments: `->(x, f){ f[x] }`. Since `&` is the partial application operator, `:& & ~:^` means you partially apply the flipped function application operator to the partial application operator. Anyone else getting semantic satiation?
Finally, we've got `%` in the middle. The `%` operator has different functionalities depending on its arguments, but in this case it denotes a "hook": given a binary function `F` and a unary function `G`, it returns a function that applies `G` to one of its two arguments before passing them on to `F`: `F % G == ->(L,n){ F[L, G[n]] }`. In this case, that means calling a flipped map (`~:*`) on the input array L and the n-applicator function (`:& & ~:^`).
The result is mapping the n-applicator function over the supplied array of functions, applying n to each element of the array. In plain Ruby, it's equivalent to `->(L,n){ L.map { |f| f[n] } }`
[Answer]
# [Elm](https://elm-lang.org), 14 bytes
```
(|>)>>List.map
```
[`|>`](https://package.elm-lang.org/packages/elm/core/1.0.5/Basics#(%7C%3E)) is function application: `a |> f` means `f a`.
[`>>`](https://package.elm-lang.org/packages/elm/core/1.0.5/Basics#(%3E%3E)) is function composition: `(f >> g) a` is `g (f a))`.
You can try it [here](https://elm-lang.org/try). Here is a full test program:
```
import Html exposing (text)
f = (|>)>>List.map
main = 
  f 5 [\x -> x * 2, \x -> x - 1, \x -> x * x]
  |> Debug.toString
  |> text
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 2 bytes
```
v‚Ç¨
```
[Try it online!](https://tio.run/##y0rNyan8/7/sUdOa////KxkaHJ6uoqSjoHR4uxGYdgQRfkr/LQA "Jelly ‚Äì Try It Online")
Accepts a list of functions on the left in Jelly source code and the value on the right.
```
v‚Ç¨  Main Link; (x: functions, y: value)
 ‚Ç¨  For each function in x
v   Evaluate it at y
```
Less trivial answer:
# [Jelly](https://github.com/DennisMitchell/jelly), 6 bytes
```
¬≥√á$√ê¬°·∏ä
```
[Try it online!](https://tio.run/##ASsA1P9qZWxsef8xMMOXJCDDtzIkIEEgTiA0xq3/wrPDhyTDkMKh4biK////OP80 "Jelly ‚Äì Try It Online")
Full program that accepts the blackbox-functions as a tied function in the header (standard for inputting blackbox-functions for Jelly), the initial value in the third argument (first value), and the number of functions in the fourth argument (second value).
```
¬≥√á$√ê¬°·∏ä    Main Link; (x: value, y: number of functions)
   √ê¬°     Collecting intermediate values, repeat y times:
  $       - last two:
¬≥           - x
 √á          - call the helper link (the blackbox)
     ·∏ä    All but the first element
```
Basically, calls the black-box N times, where each time the function cycles its behavior (that's how tie works), and collects all N+1 results, then removes the initial value.
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), 7 bytes
```
Through
```
[Try it online!](https://tio.run/##y00syUjNTSzJTE78n2b7PySjKL80PeN/QFFmXkm0sq5dWrRzfl5xSVFpcomDg3JsrFpdcHJiXl01V3V1rY6Cca0OkKGsBmSaGIHZhgbKajoKyvpGQNIxqThaORbI0AWrMCCkwAKsAFkQqFDb0AAkp2uKRxIip6wFMRkoBqS0lLWNgPJApqExkPDNT4lW1jGO1TUGaTA0IFWHpalBLVftfwA "Wolfram Language (Mathematica) ‚Äì Try It Online")
Built-in. Input `[L[n]]`.
---
### [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), 12 bytes
```
nÔí°#@n&/@#&
```
[Try it online!](https://tio.run/##y00syUjNTSzJTE78n2b7P@/9pIXKDnlq@g7Kav8DijLzSqKrlWt17dKilY1io5VjY9UcHByquaqra3UUjGt1gAxlNSDTxAjMNjRQVtNRUNY3ApKOScVA9UCGLliFASEFFmAFyIJAhdqGBiA5XVM8khA5ZS2IyUAxIKWlrG0ElAcyDY2BhG9@SrSyjnGsrjFIg6EBqTosTQ1quWr/AwA "Wolfram Language (Mathematica) ‚Äì Try It Online")
Input `[n][L]`.
[Answer]
# [tinylisp](https://github.com/dloscutoff/Esolangs/tree/master/tinylisp), 37 bytes
```
(d C(q((F N)(i F(c((h F)N)(C(t F)N))(
```
[Try it online!](https://tio.run/##JY6xDoMwEEP3foXHu650KkMHJEam/kAIV3FSEmhyqOLraWgnP8uWZdO0By3rcdCEjt5EPQYmRU@eaEbP1XVkP2A6KCxuQtAxu7zzhfwSoyTDc84ieG3Jmy6p3KHJZzmjFnELpmvYMe5oWpgUw2cWmyUjbXGsogVr1ih1sQPVQ3YOVHJxnBxoYNAVAxrmf/HBuDV8fAE "tinylisp ‚Äì Try It Online")
### Ungolfed/explanation
```
(load library)     Library contains ungolfed aliases for builtins
(def cleave        Define cleave to be
 (lambda (F N)     a function taking a list of functions F and a number N
  (if F            If F is nonempty:
   (cons             Construct a list
    ((head F) N)      whose head is the first function in F applied to N
    (cleave           and whose tail is the result of a recursive call
     (tail F)         with the remaining functions in F
     N))              and the same number N
   nil))))         Else, return empty list
```
[Answer]
# [Standard ML (MLton)](http://www.mlton.org/), 19 bytes
(-1 from [Laikoni](https://codegolf.stackexchange.com/questions/230145/implement-a-cleave-function/230215?noredirect=1#comment547575_230215) by manipulating names and spacing on the original `fn n=>map(fn f=>f x)`.)
```
fn! =>map(fn f=>f!)
```
[Try it online!](https://tio.run/##TYzBCoAgFAR/ZbtpVFDQ0e6dO0aEREagz6iHv28SER1n2ZnL2dJZ9hSDtljsqsMKFQ1lUJ3ThzAEozqTyecwQyGtEMe5E8OjJ67YD5xwkxBvoMWYPEoJUN4U@KCsf5DTJOMN "Standard ML (MLton) ‚Äì Try It Online")
[Answer]
# Rust, 49 bytes
```
|u,k:Vec<Box<_>>|k.iter().map(|z|z(u)).collect();
```
Maximally abusing [this ruling](https://codegolf.meta.stackexchange.com/questions/25156/should-rust-anonymous-functions-fully-specify-parameter-types). Would be nearly twice as long if all types where specified.
[Playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=e2b006e3ff95c6dcada6a3bd089532c0)
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal), 1 byte
```
S
```
[Try it Online!](https://vyxal.pythonanywhere.com/#WyIiLCI1XG7in6jOuzEwKjt8zrvCvTt8zrtOO3zOuzIqNSszLTvin6kiLCJTIiwiIiwiIl0=)
A full program that takes `number` then `functions`.
## Explained
```
S # Converts each function to a string. This involves evaluating them, which somehow takes input from the stack.
```
Takes input in the header because that's how to input functions
[Answer]
# [Factor](https://factorcode.org/) + `combinators`, 6 bytes
```
cleave
```
[Try it online!](https://tio.run/##S0tMLskv@h8a7OnnbqWQnJ@blJmXCBQpVrD@n5yTmliW@v8/AA "Factor ‚Äì Try It Online")
Built-in.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 3 bytes
```
·πõƒø‚±Æ
```
[Try it online!](https://tio.run/##y0rNyan8z3V4uqEBlweXI5cflzaQdWgT1@HtYFr74Y4ljxpmcBkac6kaxxv/f7hz9pH9jzau@394ub63ZuT//9HGOgrRsbFAwsQISBiCmQZADOQBpUx0FEzBQhaYQrqmIF1Ano6CGVgAnW8IMsdcRwGo11JHAcQzhJhvaYpVBgA "Jelly ‚Äì Try It Online")
Takes \$n\$ on the left and a list of link indices on the right.
```
  ‚±Æ    For each element of the right argument,
·πõƒø     call the link at that index monadically on the left argument.
```
[Answer]
# [Red](http://www.red-lang.org), 32 bytes
```
func[g n][forall g[g/1: g/1 n]g]
```
Modifies the list in place.
Doesn't work in `TIO`, but works fine in the Red GUI console:
[![enter image description here](https://i.stack.imgur.com/bUxYf.png)](https://i.stack.imgur.com/bUxYf.png)
Here's a `TIO`-compatible version:
# [Red](http://www.red-lang.org), 41 bytes
```
func[L n][collect[foreach g L[keep g n]]]
```
[Try it online!](https://tio.run/##TYyxCoNAEAV7v@LVQooEbPwGq7TLK8LebhIiq1wU7u9PsdFuBobJlurTkrDxvvoaKgOCotM4mi7iU7aXfvDGID@zeYcgWT3@PeToC6WgxYM49Yb7VVsUspnzNxY4sqVVDfsCXd0A "Red ‚Äì Try It Online")
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 4 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
Takes the integer as input as a single digit array with the array of functions pre-assigned to variable `V`, outputs and array of single integer arrays.
```
V¬£mX
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&header=CltAWCoyfSxAWC0xfSxAWCp4fV0&code=VqNtWA&input=WzVdCi1R)
[Answer]
# [C (gcc)](https://gcc.gnu.org/), ~~62~~ 52 bytes
```
f(n,L)int(**L)();{while(*L)printf("%d ",(*L++)(n));}
```
[Try it online!](https://tio.run/##dZBBDoIwEEXX9hQTjUkHwUSjq6onaNy5Mi60LdoEiyIoCeHsOEUxunBWM7/v/06roqNSTRNzF0q0LudBIJGjqB4nmxhOwyUjOeb9oYZ@SMJohNwhiroZWKeSQhtY3HJt0/FpxX6kxB68RnbQaXFIjOW@LxEqyExeZA5KCGAqoH5BRn0Iqi8ogkkH3a7FPvuTVHbQeW8dv6dWE8B8VvsyuZ3t0BsRlqT33kuFLeHLLxCy3vsK6tYbKdvTWnQx4Mg8f43@10CiYDVrng "C (gcc) ‚Äì Try It Online")
Takes `L` as a `NULL`-terminated array of pointers to functions taking an int and returning an int. Outputs results space-separated on stdout (with a trailing space).
-10 bytes from [@EasyasPi](https://codegolf.stackexchange.com/questions/230145/implement-a-cleave-function/230223?noredirect=1#comment528265_230223)
(also [C++ (gcc)](https://gcc.gnu.org/), 79 bytes with `#include<cstdio>` and ANSI function syntax. [Try it online! (C++)](https://tio.run/##hY5BDoIwEEX3nGKCMekUWGh0VfUE3ICwMAW0SR2aWpSEcHZsQRdudBaT/Jc/f740JrtIOU0rRVJ3VX2Qd1ep9hQ9WlVBwxQ5oNRvxnmOQSIOz6vSNfPaWA8aFq8riFMPkgQZIYpxCne3syIWchCGCPzMMXmxK5cgOL55mKKcf/XeC7Z2nSXogcNWwJj@NmWw@W/i0H@ZqNPaOLuAUXzqAflS@0U2jFLIUUTj9AI "C++ (gcc) ‚Äì Try It Online"))
---
If writing to a caller-allocated array that is passed to the function is a valid form of output, then:
# [C (gcc)](https://gcc.gnu.org/), ~~59~~ 51 bytes
```
f(int n,int(**L)(),int*r){while(*L)*r++=(*L++)(n);}
```
[Try it online!](https://tio.run/##dY/BTsMwDIbP61NYQ0hJ0yFgcMrGE1TcOJUKdUnKLJUU0nZUTHn24nTtgAM@JPaf358dtXpVahhKhrYFm9DJ4jjljIc0dvz4ucfKMJJiJ8SWEiE4s1z64QKtqjptYNO0Guur/UP0R6pwF7QA1nW3qwyOQ3oOR3Cm7ZyFHmK4leBPJqPODopfphXczKbmoyvcP6R@Nr0VaNmhRk2GKLDGb6XZXc5DI4ct6YtpqWR0hAgLJNFiGkHZ41Oajq9ezhiw1Hz/U6rKFAejs3V@0kpmE0iTWeeTWjtgDX6ZlxaQANeSrg2sJQiB85Ih3h1BS7a81M92eaZkmE8gH/lo@AY "C (gcc) ‚Äì Try It Online")
Same input as above, but outputs results through `r`, which must point to at least as many `int`s as `L` does `int(*)(int)`s (not including `L`'s `NULL` terminator).
-8 bytes from [@EasyasPi](https://codegolf.stackexchange.com/questions/230145/implement-a-cleave-function/230223?noredirect=1#comment528265_230223)
(also [C++ (gcc)](https://gcc.gnu.org/), 59 bytes [Try it online! (C++)][TIO-kq6vpd7q])
[Answer]
# JavaScript, 43 bytes
I know there's already a nice JS entry, but I wanted to give it a go by giving both parameters to a single function. Different approach, same output.
Here's mine:
```
(n,a)=>a.reduce((A,F)=>A.concat([F(n)]),[])
```
[Try it online!](https://tio.run/##Pcg9CoAwDEDhq2RMJBYUHCu4eInSIdQqirTiH719dRC3771FbjncPm9nGeLg86gzBhbSrajdD5fziB33b3fKxeDkRNNjIEtsLOV3HXH1ao0TjtiwSaBbSFBAzfC5hOp3AckS5Qc "JavaScript (Node.js) ‚Äì Try It Online") Also [test cases](https://tio.run/##rZHPisMgEMbv@xRzWdBWEzUGkkMKvfS2TxBycNN0/1CS0qSLb58dtwqllr00Moh@jt9vHL/Njxnb89dp4v2w7@ZDNZOeGVptTHLu9pe2I2TLdrjfJu3Qt2Yi9Y70tKGsbuiM0jgcu@Q4fJADAcicSuG5kaZQNy931lqx2kK1AfsMwFlrFZmD8OZSrCyDKydVfvVmps/EvI/EUq/wh0U4c8HARwwploIU6K8Z@gEvIgzPPeaRY8Cupfi/jQ6TM3ARP2RJApYLMmbI8CP2plcoQhBhDepvll6TWTh8zYBD5uiOIQXewiSp3IRJPPr/Ml@MVgqVO2CJzyqF1iJAZTP/Ag "JavaScript (Node.js) ‚Äì Try It Online") (modified from Arnauld's imlementation).
This is NOT memory friendly because I had to create a new array each time I used `Array.prototype.concat`. It would have been much nicer and slightly shorter if JavaScript's `Array.prototype.push` would just return the modified array...
[Answer]
# [Mlatu](https://github.com/mlatu-lang/mlatu), 20 bytes
```
->n;{n swap call}map
```
Explanation:
`->n;` pops off the stack and binds it to `n`. The list is left as the implicit parameter of `map` and is never bound. `{n swap call}` is a closure in Mlatu, which pushes `n` (the number) onto the stack, swaps the placement of the number and the function, and then calls the function with `n` as its argument. `map` takes the list and the closure and `map`s the list with the given closure.
[Answer]
# [Binary Lambda Calculus](https://tromp.github.io/cl/cl.html), 58 bits = 8 bytes
```
0000010110000000000101110011111011111100101111011010000010
```
[Try it online!](https://tio.run/##S8pJ/v/fAAQMDQwNDeAAxANyDUEAQhpCBcHqDKGK/v8HAA "Binary Lambda Calculus ‚Äì Try It Online")
It's a higher-order function that takes in a Church numeral and a list and returns a list. The list encoding is the one where a list is identified with its right fold function (e.g. `[1, 2]` would be `\c n. c 1 (c 2 n)`). (I'm using `\` as \$\lambda\$ in this answer.)
**‚ÄúReadable‚Äù version:**
```
\\@@1\\\\@@2@46@@321\\1
```
Here, I'm using prefix notation. `\` is abstraction and `@` is application. Numbers are de Bruijin indices (starting at 1). Of course, (for example) `321` here means `3`, then `2`, then `1`, not the number `321`.
**Actually readable version:**
```
\k l. l (\a b c n. c (a k) (b c n)) (\c n. n)
```
## Explanation
Todo. It‚Äôs late and I‚Äôm tired.
[Answer]
# [Go](https://go.dev), 78 bytes
```
func(x int,F[]func(int)int)(O[]int){for _,f:=range F{O=append(O,f(x))}
return}
```
[Attempt This Online!](https://ato.pxeger.com/run?1=xVTLToNAFN244ismTUxmdNBSWtOasHDTZeu-MWYKM5UIA8JAMIQvcdOY-FH1a5wHfcTQBW5ckHmdc--5c8_w8blJtrtZSvxXsqEgJiG3wjhNMgFuwIDFYnCyjIl4GVhWSTLgR5SUFHhfhWD2dLdgBfdhBUIu8Hz1pFdyjtQHl6snNdYsycAzZvdeRrjMNa-XHklTygO4xAxWCDVWRkWR8cZE_b4oxXtKAePAA6chrXY7l_syGTeSSBDscQslBDFem3jgqE7R97sVuAaLptHkvFj3JdsHclxEfclXB3IQln3Jt8fMSe-aLw9kP-H9yIpobuutIBndkzvLq0yOMKBcnAcaEFnnZyFyCh_WOWRRQsTdWNlE-sRSYO1WiEBtPWYSFnFoXAknWJmjlm2BI4RVb6GjRq26Qeg33jX4jpPxyBzpMjrOh8dMzlCmkM3UKWVFWNkC2g7qoE3_RrPbwk5hWPleRenA94Q7bTXmnowqLa-7MwYmGyKfkblqM3carKwFHfcsVdoWuhpuA7fpkDKb_KOW9vez3ZrxBw)
### [Go](https://go.dev), 79 bytes, generic
```
func f[T any](x T,F[]func(T)T)(O[]T){for _,f:=range F{O=append(O,f(x))}
return}
```
[Attempt This Online!](https://ato.pxeger.com/run?1=xVQxboMwFF06cQorUiW7gTaEpEorZeiSMXRgi1DlAG5RwVBjIiLECXqELlGlHio9TW0MSVSRgS4dkM33e__97__g4_M52e2HKfZe8XMAYhxSLYzThHFwDQYk5oOT1xjzl8FXzokx29skpx4gKwdgunVhARx9sXJlEDrIQdBeuQ4qScLAk07u5wxTkX5R2nOcpgH1oa0TWCBUaSzgOaOVSvt98b7BDHhRgDcBmIv8IeWupvFtGgBCZUQqiCASTxvORFxoU02TZOz7LW4JJJLQUomoYAEaehstwBAsq6omZ_m6L9k4kOM86ku-OpD9cNOXfHNUTnr3fHkgewntR5ZEdVtvOWZBS-5sr1AaoR9Qfh6oQHidnYWILXxYZ5BECea3E-kdYR6tdqF0LUSg1B6ZgEUUKv_AqS7NUYqxwDHS5WyhKde66gqh33hL4TtOJmN1VLfRcT46KpkjISGGWUuKjnRpC2iYqIM2-xvNaBo7henS9zJLB74n3Gy6UfekqqrL656MgomBiM9IXbXam5UurQVN6yxV2BZaNdwAVtVRyt30H2tp_km7nVp_AA)
[Answer]
# [Lua](https://www.lua.org/), 55 bytes
```
function g(L,n)for k,v in pairs(L)do print(v(n))end end
```
[Try it online!](https://tio.run/##Tcs7DoAgEITh3lNsuWuo9BpcwvgKwQxmARvj2fFRqMU0/5dZclfKlNEnF0AzWwOZgpI3GznQ2jmNbGUItKpD4o0hMmKga9/PX1XHlBWEurmtei3@rX1s5t2beJhGygk "Lua ‚Äì Try It Online")
]