In software engineering, a domain model is a conceptual model of the domain

A well designed functional program, on the other hand, will have a strong focus on data types rather than behavior.-- Scott Wlaschin
type [typename] = [existingType]
type Name = String
type Fruit = Apple
type FirstName = string
type LastName = string
let name firstName lastName = firstName + " " + lastName
let firstName: FirstName = "Jia-Wei"
let lastName: LastName = "Lin"
name firstName lastName //ok
name lastName firstName //ok
type FirstName = FirstName of string
type LastName = LastName of string
let firstName = FirstName "Jia-Wei"
let lastName = LastName "Lin"
let name (FirstName firstName) (LastName lastName) = firstName + " " + lastName
name firstName lastName // ok
name lastName firstName // error
type Fruit =
| Apple
| Banana
| Papaya
let fruitList = [ Apple; Banana; Papaya ]
for fruit in fruitList do
match fruit with
| Apple -> printfn "Yes! I love apple."
| Banana -> printfn "Yes! I love banana."
| Papaya -> printfn "Yes! I love papaya."
type Fruit =
| Apple of string
| Banana of string
| Papaya of string
let fruitList =
[ Apple "red apple"
Banana "yellow banana"
Papaya "Papaya!" ]
for fruit in fruitList do
match fruit with
| Apple value -> printfn "Yes! I love %A." value
| Banana value -> printfn "Yes! I love %A." value
| Papaya value -> printfn "Yes! I love %A." value
A & B & C
type Person1 = {Frst:string; Last:string}
type Card = Suit * Rank
A + B + C
type Fruit = Apple | Banana | Papaya
ADTtype UserContact ={
FirstName: String50
MiddleInitial: String1 option
LastName: String50
contactMethod: EmailAddress | PhoneNumber
}
https://www.youtube.com/watch?v=2JB1_e5wZmU https://fsharpforfunandprofit.com/posts/overview-of-types-in-fsharp/