It is often said that
tru t f = t
fls t f = f
represent True and False in the sense that "we can use those terms to perform the operation on testing the truth of a boolean value".
But that hides an important caveat in that it seems only true in the untyped lambda calculus. If I just plug those values in haskell, I can write a function :
tryMeOnFalse ∷ (∀ t f. t → f → t) → String
tryMeOnFalse tr = "Hi"
a' = tryMeOnFalse tru
b' = tryMeOnFalse fls -- type error !
which distinguishes tru and fls at the type level. How wrong/true would it be to say that :
- in STLC
truandflsare value level witness of some promoted'Booleankind, which has types'Trueand'False - in STLC the (coerced) typed values
(tru :: ∀ t . t → t → t)and(fls :: ∀ t . t → t → t)represent True and False (and in untyped, well the usual)
Edit : I now realize thanks to @Daniel Wagner's answer I was thinking of Second Order Lambda Calculus and not STLC in my question.