Skip to content

Instantly share code, notes, and snippets.

@phadej

phadej/Exists.hs Secret

Created September 23, 2020 22:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phadej/539de5929c6acad3b8e2fa60fbf68f14 to your computer and use it in GitHub Desktop.
Save phadej/539de5929c6acad3b8e2fa60fbf68f14 to your computer and use it in GitHub Desktop.
{-# LANGUAGE GADTs, DataKinds, TypeOperators #-}
import Data.Type.Equality
data Exists where
MkExists :: a -> Exists
thm :: 'MkExists 'True :~: 'MkExists 'False
thm = Refl
{-
Exi.hs:9:7: error:
• Couldn't match type ‘'True’ with ‘'False’
Expected type: 'MkExists 'True :~: 'MkExists 'False
Actual type: 'MkExists 'True :~: 'MkExists 'True
• In the expression: Refl
In an equation for ‘thm’: thm = Refl
|
9 | thm = Refl
| ^^^^
-}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment