When you write larger programs, it becomes essential to be able to structure the code into hierarchical abstraction levels. This makes it possible to build larger programs, reuse existing code, and let others understand the code as well. In F# there are namespaces, modules, and object orientation together with types and data structures to do this. In object orientation, there are possibilities to make functions and variables private and to disable outside access. Object orientation will be covered in a section by itself later on.
As you may have seen in Visual Studio, when you have created your F# projects, there exist various types of source code files. They have different extensions depending on their use. In this book we use .fs
and .fsx
files. The former is an F# source code file to be compiled and used in an executable program. The latter, .fsx
, is used for F# scripts and interactive mode for prototyping. Scripts are excellent for prototyping and exploratory...