Skip to content

Instantly share code, notes, and snippets.

@llelf
Last active August 29, 2015 14:04
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 llelf/6cc8a147079434788bc0 to your computer and use it in GitHub Desktop.
Save llelf/6cc8a147079434788bc0 to your computer and use it in GitHub Desktop.
> {-# 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