Function form of indexer?

Similar to how I can do

let add1 = (+) 1
let two = add1 1  // 2

Is it possible to do something like

let foo = [| 1; 2; 3 |]
let at = ([]) foo
let two = at 1 // 2

Possibly with different syntax, of course?

Just so I don’t have to write

let at i = foo.[i]

Module Array contains functions for this:
Array.get or Array.item and safer version, that doesn’t throw IndexOutOfRangeException, Array.tryItem:

let foo = [| 1; 2; 3 |]
let at = Array.get foo
let two = at 1 // 2
1 Like