Skip to content

Instantly share code, notes, and snippets.

@jasondown
Created January 23, 2019 20:29
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 jasondown/7cf41fc07f86e1484e4db6508b69152b to your computer and use it in GitHub Desktop.
Save jasondown/7cf41fc07f86e1484e4db6508b69152b to your computer and use it in GitHub Desktop.
type Module =
| StartPos
| Samples // <------------------- New Union Case
| Diagnosis
| Molecules
| Laboratory
static member Create moduleName =
match moduleName with
| "START_POS" -> Module.StartPos
| "SAMPLES" -> Module.Samples // <------------------- New Union Case
| "DIAGNOSIS" -> Module.Diagnosis
| "MOLECULES" -> Module.Molecules
| "LABORATORY" -> Module.Laboratory
| name -> failwithf "Unknown module type: %s" name
override x.ToString () =
match x with
| StartPos -> "START_POS"
| Samples -> "SAMPLES" // <------------------- New Union Case
| Diagnosis -> "DIAGNOSIS"
| Molecules -> "MOLECULES"
| Laboratory -> "LABORATORY"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment