Skip to content

Instantly share code, notes, and snippets.

@sean-clayton
Last active September 13, 2019 22:24
Show Gist options
  • Save sean-clayton/141c297b260ec755bc5305fcfbead1f0 to your computer and use it in GitHub Desktop.
Save sean-clayton/141c297b260ec755bc5305fcfbead1f0 to your computer and use it in GitHub Desktop.
type maybeString = string option
let myMaybeString: maybeString = Some "howdy"
let myString =
match myMaybeString with
| Some s -> s
| None -> ""
type maybeString = option(string);
let myMaybeString: maybeString = Some("howdy");
switch (myMaybeString) {
| Some(s) => s;
| None => ""
}
var myMaybeString = "howdy";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment