1
如何阅读GHC Core的“证明”?
我写了少量的Haskell,以了解GHC如何证明对于自然数,您只能将偶数减半: {-# LANGUAGE DataKinds, GADTs, KindSignatures, TypeFamilies #-} module Nat where data Nat = Z | S Nat data Parity = Even | Odd type family Flip (x :: Parity) :: Parity where Flip Even = Odd Flip Odd = Even data ParNat :: Parity -> * where PZ :: …