Skip to content

Instantly share code, notes, and snippets.

@vasily-kirichenko
Created June 27, 2014 13:08
Show Gist options
  • Save vasily-kirichenko/0e5d6d787457338d7dd8 to your computer and use it in GitHub Desktop.
Save vasily-kirichenko/0e5d6d787457338d7dd8 to your computer and use it in GitHub Desktop.
// before
entity.BaseType
|> Option.bind (fun bt ->
if bt.HasTypeDefinition then Some bt.TypeDefinition
else None)
// after
match entity.BaseType with
| Some (TypeWithDefinition def) -> Some def
| _ -> None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment