F# allows any of these:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
type myrecord1 =
    {
        foo : string;
        bar : int
    }
 
type myrecord2 =
    {
        foo : string
        bar : int
    }
 
type myrecord3 = {
        foo : string
        bar : int
    }
 
type myrecord4 = { foo : string; bar : int }
 
type myrecord5 =
 {
    foo : string
    bar : int
 }


and many others. But yes, you cannt have the curly brace on the first column of the next line, as that's where there next declaration after the 'type' will begin. These are the trade-offs of a whitespace significant language.

By on 6/23/2011 3:52 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