Please see the code below.
let x = Seq.head [1.0; 2.0] // This is ok. type Func<'T> = { f: seq<'T> -> 'T } let func = { f = Seq.head } // Compilation error: This expression was expected to have type seq<obj> but here has type 'a list let y = func.f [1.0; 2.0] let z = func.f ([1.0; 2.0] |> List.toSeq) // This is ok.
I don’t understand why here the behavior of Seq.head and fund.f is different. This seems like a compiler error. However, if it is by design, can someone help me explain a little? Thank you very much!
source share