Skip to content

Instantly share code, notes, and snippets.

@AyaMorisawa
Last active December 15, 2015 15:37
Show Gist options
  • Save AyaMorisawa/0d05e9154cea4b8afa06 to your computer and use it in GitHub Desktop.
Save AyaMorisawa/0d05e9154cea4b8afa06 to your computer and use it in GitHub Desktop.

y x = x (y x)の型推論

  1. y :: bとおく。
  2. x :: cとおく。
  3. y x :: dとおく。
  4. (1.)(2.)(3.)よりbc -> dは等しい。
  5. (4.)よりy :: c -> dである。
  6. x (y x) :: aとおく。
  7. (2.)(3.)(6.)よりcd -> aは等しい。
  8. (2.)(7.)よりx :: d -> aである。
  9. (5.)(7.)よりy :: (d -> a) -> dである。
  10. (6.)(8.)より\x -> x (y x) :: (d -> a) -> aである。
  11. (9.)(10.)よりdaは等しい。
  12. (11.)よりy :: (a -> a) -> aである。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment