100X Faster - Takes an array and splits it to arrays of arrays
Fast version - http://www.fssnip.net/sB
1: 2: 3: 4: 5: 6: 7: 8: 9:
//Fast version for http://www.fssnip.net/sB//Check on 1000000 elements arrayletFastSlicechunkarr=letlen=arr|>Array.lengthletres=Array.init (len/chunk) (funx->arr.[(x*chunk)..((x+1)*chunk-1)])
len%chunk|>function
|0->res
|x->[|arr.[len-x..]|]|>Array.appendres
val FastSlice : chunk:int -> arr:'a [] -> 'a [] []
Full name: Script.FastSlice
val chunk : int
val arr : 'a []
val len : int
module Array
from Microsoft.FSharp.Collections
val length : array:'T [] -> int
Full name: Microsoft.FSharp.Collections.Array.length