Friday, 10 September 2010

Calling F# function from C# application

  • Download and install F#
  • Create new Project Visual F# / F# Library
  • Create a sample Module
module MathLib
    let square x = x*x 
  • Create new C# Console Project
  • Add Reference to F# Library project
  • Call function from F# module
class Program
{
    static void Main(string[] args)
    {
        Console.WriteLine(MathLib.square(4));
        Console.ReadLine();
    }
}

No comments:

Post a Comment