Confused with the order of the argument F # List.nth

List.nth is 'T list β†’ int β†’' T , not the standard int β†’ 'T list β†’' T like Seq.nth .

This makes the pipeline somewhat uncomfortable.

Is there something behind the scenes?

I do not know why.

+6
f #
source share
2 answers

Perhaps for ocaml compatibility (or just laziness), but without deeper considerations regarding the implementation itself.

+6
source share

This signature allows you to perform a function on this list. This allows you to store List.nth someList and use it to get the nth element of the list without having to specify a list variable every time.

I am not sure why it is uneven in relation to other F # functions.

+1
source share

All Articles