Porting C# to F#
Class Implementing an Interface
Classes implement an interface to meet the interface's contract. For example, a C# class may implement
To implement an interface in F#, use
interface in the type definition,
Some of the simplest kinds of classes are POCOs.
In F# 3.0, auto-properties similar to C# auto-properties were introduced,
Creation of an instance of either is similar,
If you can use immutable values, a record type is much more idiomatic F#.
And this record can be created:
Records can also be created based on other records by specifiying the existing record and adding
with, then a list of fields to override:
This modified text is an extract of the original Stack Overflow Documentation created by following contributors
and released under CC BY-SA 3.0