Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type array<'t, 'ndims> =
- {
- nrows : int
- ncols : int
- }
- type ndims2 =
- static member index (a:array<_, ndims2>) =
- let indexImpl (i:int, j:int) = i + j*a.nrows
- indexImpl
- let inline indexer (a:array<_, 'ndims>) =
- (^ndims : (static member index : array<_, ^ndims> -> _) a)
- let x : array<float, ndims2> = {nrows = 2; ncols = 2}
- let i = indexer x
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement