3

I noticed that the signature of nth of Seq differs from that of List in the placement of the index (int).

I've just noticed it after I tried the following:

[1..10] |> List.nth 2      // error
2 |> List.nth [1..10]      // working, but looks awkward for me
List.nth [1..10] 2         // I suspect this is the expected use 
seq { 1..10 } |> Seq.nth 2 // working

I'm aware that it's not possible to determine initially the number of items in Seq because it's computed lazily unlike that of List, I just don't see how their difference will affect the signature of List.nth.

Deduplicator
  • 44,692
  • 7
  • 66
  • 118
OnesimusUnbound
  • 2,886
  • 3
  • 30
  • 40
  • 1
    and here is one more, with some possible answers: http://stackoverflow.com/questions/15184949/different-argument-order-for-getting-n-th-element-of-array-list-or-seq (Honestly, I have no idea - it looks pretty silly!) – Tomas Petricek Aug 22 '13 at 04:57
  • 1
    @TomasPetricek thanks for the comments. The question is indeed a duplicate. – OnesimusUnbound Aug 22 '13 at 05:18

0 Answers0