Created
August 14, 2015 01:51
-
-
Save Porges/3397c4c8bd7c938d1a1d 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 ConstraintKinds #-} | |
{-# LANGUAGE ExistentialQuantification #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE KindSignatures #-} | |
import GHC.Exts (Constraint) | |
data Exists (t :: * -> Constraint) = forall a. t a => Exists a | |
instance Show (Exists Show) where | |
show (Exists x) = show x | |
showables :: [Exists Show] | |
showables = [Exists 1, Exists "2", Exists '3'] | |
main = mapM_ print showables |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment