Last active
August 29, 2015 14:04
-
-
Save llelf/6cc8a147079434788bc0 to your computer and use it in GitHub Desktop.
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 RankNTypes, DataKinds, KindSignatures, GADTs #-} | |
> import Unsafe.Coerce | |
> data M = A | B deriving (Show, Eq) | |
> data V1 :: M -> * where | |
> V1A :: Int -> V1 A | |
> V1B :: Double -> V1 B | |
> V1a :: () -> V1 a | |
> zu :: V1 a | |
> zu = unsafeCoerce (V1A 2) | |
> main = putStrLn $ case zu of | |
> V1A{} -> "A" | |
> V1B{} -> "B" | |
> V1a{} -> "O_o" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment