Hey, I am looking to get first n elements of a list:
let rec first_helper accum n l =
match n, l with
| 0, _ -> accum |> List.rev
| n, h :: t -> first_helper (h :: accum) (n - 1) t
| _, _ -> accum |> List.rev
let first = first_helper []
However, I am getting weak types:
val first_helper : 'a list -> int -> 'a list -> 'a list = <fun>
val first : int -> '_weak3 list -> '_weak3 list = <fun>
Why is this so?