1 people like it.

Auto-Properties

1: 
2: 
3: 
4: 
5: 
6: 
/// mutable class with auto-properties
type Person(name : string, age : int) =
    /// Full name
    member val Name = name with get, set
    /// Age in years
    member val Age = age with get, set
Multiple items
type Person =
  new : name:string * age:int -> Person
  member Age : int
  member Name : string
  member Age : int with set
  member Name : string with set

Full name: Script.Person


 mutable class with auto-properties


--------------------
new : name:string * age:int -> Person
val name : string
Multiple items
val string : value:'T -> string

Full name: Microsoft.FSharp.Core.Operators.string

--------------------
type string = System.String

Full name: Microsoft.FSharp.Core.string
val age : int
Multiple items
val int : value:'T -> int (requires member op_Explicit)

Full name: Microsoft.FSharp.Core.Operators.int

--------------------
type int = int32

Full name: Microsoft.FSharp.Core.int

--------------------
type int<'Measure> = int

Full name: Microsoft.FSharp.Core.int<_>
val set : elements:seq<'T> -> Set<'T> (requires comparison)

Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.set
Raw view Test code New version

More information

Link:http://fssnip.net/8B
Posted:13 years ago
Author:
Tags: