1

I have an example of System F plymorphism that I don't really understand: enter image description here

If I would remove the types it would remain: \f.\a.f (f a) which makes no sense.

Can you help me with this? Thank you!

yonutix
  • 1,964
  • 1
  • 22
  • 51

1 Answers1

4

The erased term does make sense: in Haskell it would be \f a -> f (f a), a fairly ordinary function that applies its first argument to its second, and then again to the result.

The difference between \f a -> <body> and \f.\a. <body> is only one of notation. If you prefer, write the Haskell term \f -> \a -> f (f a), which is equivalent but syntactically a bit closer to the erased System F.

(Note that double is not self application, which would be \f -> f f.)

gsg
  • 9,167
  • 1
  • 21
  • 23