2 people like it.

Trying to set a default value

Trying to set a string option

 1: 
 2: 
 3: 
 4: 
 5: 
 6: 
 7: 
 8: 
 9: 
10: 
11: 
type Config = {
    home_folder: string option
    }

let default_config: Config = {
    home_folder: None}

let server_config = {
    default_config with
        home_folder = address
        }
Config.home_folder: string option
Multiple items
val string : value:'T -> string

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

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

Full name: Microsoft.FSharp.Core.string
type 'T option = Option<'T>

Full name: Microsoft.FSharp.Core.option<_>
val default_config : Config

Full name: Script.default_config
type Config =
  {home_folder: string option;}

Full name: Script.Config
union case Option.None: Option<'T>
val server_config : Config

Full name: Script.server_config
Raw view Test code New version

More information

Link:http://fssnip.net/pv
Posted:9 years ago
Author:joobus
Tags: set