Skip to content

Instantly share code, notes, and snippets.

@Rufflewind
Forked from ion1/PeirceLEM.hs
Created April 7, 2015 09:00
Show Gist options
  • Select an option

  • Save Rufflewind/2bf0202e016ee9b74b6d to your computer and use it in GitHub Desktop.

Select an option

Save Rufflewind/2bf0202e016ee9b74b6d to your computer and use it in GitHub Desktop.
-- Exercise: prove Pierce’s law <=> law of excluded middle in Haskell
{-# LANGUAGE Rank2Types #-}
import Data.Void
type Not a = a -> Void
type Pierce = forall a b. ((a -> b) -> a) -> a
type LEM = forall a. Either (Not a) a
callCC_lem :: Pierce -> LEM
callCC_lem callCC = _
lem_callCC :: LEM -> Pierce
lem_callCC lem = _
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment