<Query Kind="FSharpProgram" />

let a = [|1..3|] // [|1; 2; 3|]
printfn "a = %A" a

let b = [| for x in 10..10..30 do yield x+1 |]
printfn "b = %A" b

let c = [| for x in 10..10..30 do yield [|x+1; x+2; x+3|] |]
printfn "c = %A" c

let d = [| for x in 10..10..30 do yield! [|x+1; x+2; x+3|] |]
printfn "d = %A" d

printf "... "
for x in [| 10; 20; 30 |] do
    printf "%d " x
printfn ""

let e = [|10|]
printfn "e = %A" e

let f = Array.length [|10; 20; 30|]
printfn "f = %A" f

let g = Array.map (fun x -> x + 1) [|10; 20; 30|]
printfn "g = %A" g

let h = Array.fold (fun s x -> s + x) 0 [|10; 20; 30|]
printfn "h = %A" h

let i = Array.sum [|10; 20; 30|]
printfn "i = %A" i

let j = Array.concat ([[|11; 12; 13|]; [|21; 22; 23|]; [|31; 32; 33|]])
printfn "j = %A" j

let k = Array.collect (fun x -> [|x+1; x+2; x+3|]) [|10; 20; 30|]
printfn "k = %A" k

// ---

let inc1 x = x + 1 // int -> int

let arrayinc1 = Array.map inc1

let g1 = arrayinc1 [|10; 20; 30|]
printfn "g1 = %A" g1

let inc2 x = [| x+1 |] // int -> int []

let arrayinc2 = Array.collect inc2

let g2 = arrayinc2 [|10; 20; 30|]
printfn "g2 = %A" g2

// ---

let l = [10; 20; 30].[2] // no nth
printfn "l = %A" l

a.[2] <- 33
printfn "a = %A" a

let n = Array.empty<int>
printfn "n = %A" n

let o = Array.filter (fun x -> x % 4 <> 0) [|10; 20; 30|] // where
printfn "o = %A" o

let p = Array.create 3 100
printfn "p = %A" p

let q = Array.init 3 (fun i -> (i+1)*100)
printfn "q = %A" q

let z = Array.zip [|1; 2; 3|] [|10; 20; 30|] // must have same len
printfn "z = %A" z