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