Skip to content

Instantly share code, notes, and snippets.

@hanpari
Created January 6, 2018 12:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hanpari/d86ba3fa1e3a6fdc54346cc4c8463f20 to your computer and use it in GitHub Desktop.
Save hanpari/d86ba3fa1e3a6fdc54346cc4c8463f20 to your computer and use it in GitHub Desktop.
ADT
open System
type Choice = Include of List<string> | Exclude of List<string>
let getProfile (name:string) (args:Choice Option):string =
match args with
| Some args -> match args with
|Exclude args -> sprintf "Name: %s Exclude: %O" name args
|Include args -> sprintf "Name: %s Include: %O" name args
| None -> sprintf "Name: %s" name
[<EntryPoint>]
let main argv =
getProfile "name" None |> printfn "%s"
let incl = Include ["sd";"sdsd"]
let excl = Exclude ["dss"; "ddf"]
getProfile "name" (Some incl) |> printfn "%s"
getProfile "name" (Some excl) |> printfn "%s"
let s = Console.ReadKey()
1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment