why does not this code work?
type Test() =
static member func (a: seq<'a seq>) = 5.
let a = [[4.]]
Test.func(a)
It gives following error:
The type 'float list list' is not compatible with the type 'seq<seq<'a>>'
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Change your code to
The trick is in the type of a. You need to explicitly allow the outer seq to hold instances of seq<‘a> and subtypes of seq<‘a>. Using the # symbol enables this.