I am new to programming and F# is my first language.
Here are the relevant parts of my code:
let rec splitArrayIntoGroups (inputArray: string[]) (groupSize: int) (hashSetOfGroups: HashSet<string[]>)=
let startIndex = 0
let endIndex = groupSize - 1
let group = inputArray.[startIndex .. endIndex]
let nextInputArray = inputArray.[groupSize .. inputArray.Length - 1]
hashSetOfGroups.Add(group) |> ignore
splitArrayIntoGroups nextInputArray groupSize hashSetOfGroups
let hashSetOfGroups = new HashSet<string[]>()
splitArrayIntoGroups urlArray 10 hashSetOfGroups
urlArray is an array of almost 3200 URLs.
When I try to run the code in F# interactive, I receive the following error message:
Program.fs(119,1): error FS0030: Value restriction. The value 'it' has been inferred to have generic type val it : '_a Either define 'it' as a simple data term, make it a function with explicit arguments or, if you do not intend for it to be generic, add a type annotation.
What went wrong, and what changes should I make?
splitArrayIntoGroupsfunction? If it just makes side effects it should return unit but in this case I suppose it will not terminate normally. - Petr