Hi, this is possible, but I'd agree that the syntax is difficult to guess.
Perhaps the compiler error message could detect this and suggest the right syntax.. that would be nice.

1
2
3
4
5
6
7
8
9
10
 
type B = {
    Test: string
    A: A
}

and A = { // <- using "and" here instead of "type"
    Test: string
    BB: B list
}

BTW: there is a known limitation that you can declare recursive types only across a single file - the F# team is aware of this issue, but I'm not sure what is the plan...

By on 1/28/2009 4:51 PM ()

Hi, this is possible, but I'd agree that the syntax is difficult to guess.

Thank you very much! Could you please also point me into the right place within spec?

By on 1/29/2009 10:45 AM ()

Hi Mike, F# CTP spec can be found here.

By on 2/5/2009 12:25 PM ()

Hi, this is possible, but I'd agree that the syntax is difficult to guess.
Perhaps the compiler error message could detect this and suggest the right syntax.. that would be nice.

This is one of thoose instances where I think that *if* the compiler can indeed detect the issue and give me the correct solution. It should instead have solved my problem.

By on 1/28/2009 11:10 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper