I've got a problem for which I am not sure which data-type to use. Currently I have gone for Array2D<'T>
, but I may change my mind in the future to use another container. In C++ I would be using instance methods, and I could use a typedef
which I could change at any point (so long as my new container supported all the required methods). This would provide a clean abstraction layer allowing me to change as I see fit.
How might I do something similarly in F#? Is there any use for typedef
? Is this what one would use Haskell's 'higher kinded types' for?