Created
August 24, 2017 16:36
-
-
Save eborden/202441b15e60c7b1f2c3627e4a781676 to your computer and use it in GitHub Desktop.
Compaction failing on an existential type carrying a type class dict
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
#!/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