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();
    }
}

Comments

Popular posts from this blog

Parse XML to dynamic object in C#

C# Crop white space from around the image