Home » F# Do Binding

F# Do Bindings

Do binding is used to execute code without defining function or type. You can write independent code by using do bindings in F#.


F# without Do Binding Example

The above program will throw an error because the print statement which is used inside class. It is not allow directly in the class. We can execute the same code with the help of do bindings. Let’s see how?


F# with Do Bindings Example

Output:

Hello FSharp 
Next TopicF# Type Inference

You may also like