Implement in Haskell the Church encoding of the pair for polymorphic λ-calculus/System F
问题 I want to implement the Church encoding of the pair in polymorphic lambda calculus in Haskell. On page 77, section 8.3.3 of Peter Selinger's notes on lambda calculus, he gives a construction of the cartesian product of two types as A×B = ∀α.(A→B→α)→α ⟨M,N⟩ = Λα.λf A→B→α .fMN For another source, on page 54, section 4.2.3 of Dider Rémy's notes on lambda calculus, he defines the Church encoding of the pair in polymorphic λ-calculus/System F as Λα₁.Λα₂.λx₁∶α₁.λx₂∶α₂.Λβ.λy∶α₁→α₂→β. y x₁ x₂ I think