Skip to content

Instantly share code, notes, and snippets.

@Porges
Created August 14, 2015 01:51
Show Gist options
  • Save Porges/3397c4c8bd7c938d1a1d to your computer and use it in GitHub Desktop.
Save Porges/3397c4c8bd7c938d1a1d to your computer and use it in GitHub Desktop.
{-# 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