Why aren't there existentially quantified type variables in GHC Haskell

前端 未结 2 2042
小蘑菇
小蘑菇 2021-02-07 03:11

There are universally quantified type variables, and there are existentially quantified data types. However, despite that people give pseudocode of the form exists a. Int

相关标签:
2条回答
  • 2021-02-07 03:25

    It is unnecessary.

    By Skolem's Theorem we could convert existential quantifier into universal quantifier with higher rank types:

    (∃b. F(b)) -> Int   <===>  ∀b. (F(b) -> Int)
    

    Every existentially quantified type of rank n+1 can be encoded as a universally quantified type of rank n

    0 讨论(0)
  • 2021-02-07 03:47

    Existentially quantified types are available in GHC, so the question is predicated on a false assumption.

    0 讨论(0)
提交回复
热议问题