Home » F# Comments

F# Comments

F# comments are statements that are not executed by the compiler. The comments in F# programming can be used to provide explanation of code, variable, method or class. By the help of comments you can hide program code also.

There are two types of comments in F#.

  • Single line comment
  • Multiline comment

F# Single Line Comment

Single line comment starts with //(double slash). Let’s see an example of single line comment in F#.

Output:

10  

F# Multiline Comment

The F# multiline comment is used to comment multiple lines of code. It is surrounded by opening and closing brackets with astrick(*). Let’s see an example of multiline comment in F#

Output:

20  

You may also like