RosettaCodeData/Task/First-class-functions/Pluto/first-class-functions.pluto
2026-04-30 12:34:36 -04:00

9 lines
210 B
Text

local compose = |f, g| -> (|x| -> f(g(x)))
local A = { math.sin, math.cos, |x| -> x * x * x }
local B = { math.asin, math.acos, math.cbrt }
local x = 0.5
for i = 1, 3 do
print(compose(A[i], B[i])(x))
end