FSharp

This category contains 6 posts

F Sharp for beginners: Modules in F #

List of articles of F Sharp beginner series All the codes you write in F Sharp are by default in a MODULE, regardless of the fact that whether you explicitly define a module or not. Anonymous Module Anonymous module has the same name as of file name with first letter in upper case. Let us … Continue reading »

FSharp for beginners: what is List.map function?

List.map function creates a new collection by applying a function to the given collection. Just have a look on below example, When you print r1 you should get the output as 2,3,4,5 Expected output In previous example I explicitly defined the input function. However it is not required, you can use List.map as below, In … Continue reading »

FSharp for beginners : Finding Square of Range of Numbers in F#

This post is targeting audience starting with F Sharp. Level: 100 We can fine square of range of numbers in F# using List.Map If you have range of numbers from 1 to 10 declared as below, And a function to calculate square as below, List.Map takes two parameters. It takes a mapping and the list. … Continue reading »

Variables and Function in F#

Variable and functions both defined with let construct in F#. Defining a integer variable let a = 2 in a*a ; printfn "%d"a;; System.Console.ReadKey(true); In above snippet we defined a integer variable in F# with let constructs. In F# teypes autemetically get inferred. In above declaration type is automatically get inferred to int. Output The … Continue reading »

Loops in F#

In this article we will explore of loops in F#. Start visual studio. Create a new project and from Visual F# tab select F# Application project type. All the basic working of loops is exactly the same as it works in other language While Loop While loops until Boolean predicate value evaluates to false. There … Continue reading »

Hello, World F# program

Objective This is very basic article, which will give demonstration on how to write first F# program Step 1 Open visual studio 2010 create new F# application by selecting F# Application project template in Windows tab under Visual F# language category Step 2 In solution explorer, you can see a file Program.fs has been created … Continue reading »

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,380 other followers

Tweets

Categories

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my current or previous employer's view in anyway. © Copyright 2012