You can refer to a member of one module inside another module. In this case, you must qualify the name of the member from its parent module. To do this where needed, type the name of the module, followed by a period, and followed by the name of the member. Here are examples: module CommercialBank = let employeeName = "Frank Nahor" let employeePhone = "1029293804" module CarDealership = let employeeName = "Jeremy Willing" let emailAddress = "jwilling@hotmail.com" let vehiclePrice : int = 26780; module VehicleFinancing = let interestRate = 16.85 let datePaymentsStart = "Next Month" printfn "Financing Summary" printfn "" printfn "Loan processed by: %s (%s)" CarDealership.employeeName CarDealership.emailAddress printfn "Loan approved by: %s, %s" CommercialBank.employeeName CommercialBank.employeePhone printfn "Vehicle Price: $%d" CarDealership.vehiclePrice printfn "Interest Rate: %0.02f" interestRate printfn "Payments Start: %s" datePaymentsStart This would produce: Vehicle Financing Summary  Loan processed by: Jeremy Willing (jwilling@hotmail.com) Loan approved by: Frank Nahor, 1029293804 Vehicle Price: $26780 Interest Rate: 16.85 Payments Start: Next Month Press any key to continue . . .
One module can be created in the body of another module. This is referred to as nesting a module. Here is an example: module Geometry =
printfn "Geometry is the branch of mathematics that studies shapes, figures, and space."
module Polygons =
type Square() =
member this.Describe() =
printfn "A square is a quadrilateral with four equal sides and four equal angles of 90 degrees."
The outside module that contains the second module is referred to as nesting. The module inside of another is referred to as nested. Any of those modules can contain any type of member. In the same way, any module can contain its own modules. To access a member of a module outside its parent, you must fully qualify its name. Here are example: module Geometry =
printfn "Geometry is the branch of mathematics that studies shapes, figures, and space."
module Polygons =
type Square() =
member this.Describe() =
printfn "A square is a quadrilateral with four equal sides and four equal angles of 90 degrees."
type Triangle() =
member this.Describe() =
printfn "A triangle is a polygon that has three edges and three vertices."
module Planes =
type Circle(radius) =
do
printfn "A circle is a shape of all point that are at an equal distance from another point named the center."
type Ellipse(largeRadius, smallRadius) =
member this.Describe() =
printfn "An ellipse is curved plane with two focal points."
module Trigonometry =
type Triangle() =
member this.Describe() =
printfn "A triangle is a plane shape from three leveled points."
module Summary =
printf "Triangular Polygon Definition: "
let geo = Geometry.Polygons.Triangle()
geo.Describe()
printf "Trigonometric Triangle Definition: "
let tri = Trigonometry.Triangle()
tri.Describe()
This would produce: Geometry is the branch of mathematics that studies shapes, figures, and space. Triangular Polygon Definition: A triangle is a polygon that has three edges and three vertices. Trigonometric Triangle Definition: A triangle is a plane shape from three leveled points. Press any key to continue . . . 


