F# Scribbles

My experiments with F#

Create m x n array initialized with 1

In python numpy,

1
tile(1, (5,2))

will give

1
2
3
4
5
> array([[1, 1],
>    [1, 1],
>    [1, 1],
>    [1, 1],
>    [1, 1]])

similarly in F#

1
Array2D.init 5 2 (fun i j -> 1)

will give

1
2
3
4
5
> val it : int [,] = [[1; 1]
>                     [1; 1]
>                     [1; 1]
>                     [1; 1]
>                     [1; 1]]