Skip to content

Instantly share code, notes, and snippets.

@b4284
Created May 3, 2016 08:12
Show Gist options
  • Select an option

  • Save b4284/e399dcbf8eff31b8269b624dfc63fb31 to your computer and use it in GitHub Desktop.

Select an option

Save b4284/e399dcbf8eff31b8269b624dfc63fb31 to your computer and use it in GitHub Desktop.
type gender = Man | Woman
type human = Any of gender | Special of gender * string | B4283
type marry_result = HappilyEverAfter | ForeverAlone | DontKnowHowToMakeLoveStop
let marry x y = match (x, y) with
| (B4283, B4283) -> DontKnowHowToMakeLoveStop
| (Special (ag, an), Special (bg, bn))
when ag = bg && an = bn -> DontKnowHowToMakeLoveStop
| (B4283, _) -> ForeverAlone
| (_, B4283) -> ForeverAlone
| _ -> HappilyEverAfter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment