Created
April 9, 2015 17:32
-
-
Save ion1/9803dbd77cf88147bde7 to your computer and use it in GitHub Desktop.
Law of Excluded Middle in Cont
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
| -- Law of Excluded Middle in Cont | |
| import Data.Void | |
| import Control.Monad.Cont | |
| type Not f a = a -> f Void | |
| type Either' r a b = (a -> r) -> (b -> r) -> r | |
| hello :: String | |
| hello = | |
| (`runCont` id) $ | |
| lem (\f -> (vacuous . f) "hello") | |
| pure | |
| lem :: MonadCont f => Either' (f r) (Not f a) a | |
| lem left right = callCC (\k -> left (k <=< right)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment