Tag Archives: f-sharp

Classes and inheritance in F#

This example is similar to the Classes in Ruby example. It demonstrates a superclass for representing a car. Two subclasses are used for representing a hero car and a villain car, they inherit from the superclass.

Posted in F# | Also tagged , , , , , , , , , , | Leave a comment

Console input and output in F#

Console input and output in F# is demonstrated with the following console application. // Program.fs module Program open System // Declare the main function let main() = // Ask the user for input Console.Write(“Enter your input: “) // Read user input let input = Console.ReadLine() // Print the entered input Console.Write(“You entered: {0}”, input) // [...]

Posted in F# | Also tagged , , , , | Leave a comment