(*
In Imperative Style you tell the program every step of things it should do.
Also, you have mutable variable(s) that you change frequently.
*)

let printList lst = 
  for e in lst do
    printf "%d " e
  printfn ""

let list = [1; 2; 3; 6; 5; 1]
printf "The original list is "
printList list

let mutable doubledList = []

for e in list do
  doubledList <- doubledList @ [e * 2]

printf "The doubled list is "
printList doubledList

let mutable total = 0
for e in list do total <- total + e

printfn "The total of elements in list is %d" total

let mutable max = System.Int32.MinValue
for e in list do
  if max < e then
    max <- e

printfn "The max value amount elements in the list is %d" max
