This post from F# News states that F# can inline a function passed as an argument.
Is it always the case? Does it happen automatically?
This post from F# News states that F# can inline a function passed as
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The answer is no. If you have a function like the following, lambdas do not get inlined.
In the following code lambdas are invoked using
FSharpFunc<,>.InvokeFast()But if you mark
foldfunction asinlinesituation changes. Not onlyfoldfunction gets inlined, but lambdas get inlined as well. I used .NET Reflector to confirm that.