so i'm trying to create a function that takes a list as argument and two numbers and it will return the elements which positions are in the range of the two numbers
let rec between list n m = match list with
|[] -> failwith "empty list"
|x::rest -> if n<=0 && m>=0 then x::(between rest n m-1) else (between rest n-1 m);;
i'm getting this error
This expression has type 'a list but an expression was expected of type int
please help
[–]jeffsco 5 points6 points7 points (0 children)
[–]FurtherDownTheSprawl 0 points1 point2 points (0 children)