forked from achrissmith/Programming-FS-Examples
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCh2_Module.fs
More file actions
33 lines (29 loc) · 661 Bytes
/
Ch2_Module.fs
File metadata and controls
33 lines (29 loc) · 661 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
module Ch2_Module
type Suit =
| Heart
| Diamond
| Spade
| Club
type PlayingCard =
| Ace of Suit
| King of Suit
| Queen of Suit
| Jack of Suit
| ValueCard of int * Suit
type BinaryTree =
| Node of int * BinaryTree * BinaryTree
| Empty
type Employee =
| Manager of string * Employee list
| Worker of string
type PersonRec = { First : string; Last : string; Age : int}
type Car =
{
Make : string
Model : string
Year : int
}
type Vector =
{ X : float ; Y : float; Z : float }
member this.Length =
sqrt <| this.X ** 2.0 + this.Y ** 2.0 + this.Z ** 2.0