-
-
Save Rufflewind/2bf0202e016ee9b74b6d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Exercise: prove Peirce’s law <=> law of excluded middle in Haskell | |
| {-# LANGUAGE Rank2Types #-} | |
| import Data.Void | |
| type Not a = a -> Void | |
| type Peirce = forall a b. ((a -> b) -> a) -> a | |
| type LEM = forall a. Either (Not a) a | |
| callCC_lem :: Peirce -> LEM | |
| callCC_lem callCC = _ | |
| lem_callCC :: LEM -> Peirce | |
| lem_callCC lem = _ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment