Skip to content

Instantly share code, notes, and snippets.

@jasondown
Created December 30, 2018 02:56
Show Gist options
  • Save jasondown/0b565b84d4a1fd07170e2ab7c418de75 to your computer and use it in GitHub Desktop.
Save jasondown/0b565b84d4a1fd07170e2ab7c418de75 to your computer and use it in GitHub Desktop.
type Module =
| StartPos
| Diagnosis
| Molecules
| Laboratory
static member Create moduleName =
match moduleName with
| "START_POS" -> Module.StartPos
| "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"
| Diagnosis -> "DIAGNOSIS"
| Molecules -> "MOLECULES"
| Laboratory -> "LABORATORY"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment