I have a custom class in F# and I want to implement the [] list operator such that
let myClass = new myClassObj()
let someVal = myClass.[2]
I can’t seem to find this on the web – I probably don’t know the right term to search for… thanks in advance
You just need to implement an
Itemindexed property. E.g.