Last active
March 26, 2024 17:44
Revisions
-
stedolan revised this gist
Mar 26, 2024 . 1 changed file with 3 additions and 9 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -6,21 +6,15 @@ data False data I (f :: * -> *) where data P (x :: *) where MkP :: (a (I a) -> False) -> P (I a) falsePIP :: P (I P) -> False falsePIP h@(MkP np) = np h false :: a false = case falsePIP (MkP falsePIP) of {} main = putStrLn false -
stedolan created this gist
Mar 26, 2024 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ {-# LANGUAGE GADTs #-} -- nontermination without any recursion, even in types -- possible because of impredicativity + injectivity -- based on https://gist.github.com/leodemoura/0c88341bb585bf9a72e6 -- see also https://github.com/idris-lang/Idris-dev/issues/3687 data False data Equ (a :: *) (b :: *) where Refl :: Equ a a data I (f :: * -> *) where injCast :: Equ (I x) (I y) -> x a -> y a injCast Refl p = p data P (x :: *) where MkP :: Equ x (I a) -> (a x -> False) -> P x falsePIP :: P (I P) -> False falsePIP h@(MkP eq np) = np (injCast eq h) false :: a false = case falsePIP (MkP Refl falsePIP) of {} main = putStrLn false