F# is a first class citizen when it comes to object orientation. Although it does not support multiple inheritance, it does fully support inheritance and the use of multiple interfaces.
In F# a constructed type is a type that has a constructor, in C# this would be a class. In fact, a constructed type is represented as a .Net class, and as such is compatible with the .Net frameworks.
The definition for a constructed type is
// Class definition: type [access-modifier] type-name [type-params] [access-modifier] ( parameter-list ) [ as identifier ] = [ class ] [ inherit base-type-name(base-constructor-args) ] [ let-bindings ] [ do-bindings ] member-list ... [ end ]
A constructed type can have multiple constructors that call each other in a chain.
Members of a constructed type can be made abstract when they don’t have an implementation. If all members are abstract then the entire constructed type can be declared abstract using an
An interface in F# is declared by declaring all the members as abstract but not the constructed type its self.
Interfaces can derived from other interfaces but not from concrete constructed types.
Interfaces are implemented on constructed types using the
A constructed types interface members are not publicly visible to clients of the class. For them to use the members they will need to cast the object to the interface and then they can access the members.
When constructed types reference each other you will need to use the
and key word to make them mutually recursive types.
When using constructed types it is important know that comparison is by reference. For record types comparison is by value.
Object Expressions is a mechanism of using composition to instantiate a new object for an Interface or a base type when providing overrides for certain members.