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>>'
Change your code to
type Test() =
static member func (a: seq<#seq<'a>>) = 5.
let a = [[4.]]
Test.func(a)
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With