Created
January 6, 2018 12:31
-
-
Save hanpari/d86ba3fa1e3a6fdc54346cc4c8463f20 to your computer and use it in GitHub Desktop.
ADT
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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