Skip to content

Instantly share code, notes, and snippets.

@eborden
Created August 24, 2017 16:36
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 eborden/202441b15e60c7b1f2c3627e4a781676 to your computer and use it in GitHub Desktop.
Save eborden/202441b15e60c7b1f2c3627e4a781676 to your computer and use it in GitHub Desktop.
Compaction failing on an existential type carrying a type class dict
#!/usr/bin/env stack
-- stack --resolver nightly-2017-08-20 --install-ghc runghc --package compact
{-# LANGUAGE ExistentialQuantification #-}
module Main where
import Data.Compact
class SomeClass a where
someId :: a -> a
instance SomeClass Int where
someId = id
data Wrapper a = SomeClass a => Wrapper a
main :: IO ()
main = do
_ <- compact $ Wrapper (1 :: Int)
putStrLn "Will fail"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment