I tried recreate functional composition
fn compose<A, B, C>(f : |B| -> C,
g : |A| -> B)
-> |A| -> C{
|x| f(g(x))
}
But I get a lifetime error. I read that closures are stack based but it doesn't explain why I get this error.
let f3 = compose(f1,f2);
Can't I move the closure out of it's current scope?