How does one avoid "Value restriction" errors with F#'s Seq.cast?
- by gatoatigrado
I see that Seq has a cast function from IEnumerable to Seq, but how do I get it to work?
open System.Text.RegularExpressions;;
let v = Regex.Match("abcd", "(ab)");;
Seq.cast (v.Captures);;
This produces,
error FS0030: Value restriction. The value 'it' has been inferred to have generic type
val it : seq<'_a
Either define 'it' as a simple data term, make it a function with explicit arguments or, if you do not intend for it to be generic, add a type annotation.