Created
July 15, 2012 05:08
-
-
Save copumpkin/3115103 to your computer and use it in GitHub Desktop.
Unit is not ()
This file contains 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
{-# LANGUAGE TypeFamilies, GADTs, EmptyDataDecls #-} | |
data Empty | |
data Unit = Unit | |
data Equal a b where | |
Refl :: Equal a a | |
type family F a :: * | |
type instance F Unit = Unit | |
type instance F () = Empty | |
newtype Wrap a = Wrap { unwrap :: F a } | |
subst :: Equal a b -> p a -> p b | |
subst Refl = id | |
proof :: Equal Unit () -> Empty | |
proof eq = unwrap . subst eq . Wrap $ Unit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment