I'm trying to build a list of the indices where the list minimums occur.
let rec max_index l =
let rec helper inList min builtList index =
match inList with
| [] -> builtList
| x :: xs ->
if (x < min) then
helper xs x index :: builtList index + 1 //line 63
else
helper xs min builtList index + 1
in helper l 100000 [] 0;;
It's giving me the following error for line 63.
Error: This expression has type 'a list -> 'a list
but an expression was expected of type 'a
The type variable 'a occurs inside 'a list -> 'a list
An expression was expected of type 'a? I'm not sure why it's saying that. My guess it it has something to do with the index::builtList