Created
August 19, 2018 17:31
-
-
Save michalrus/67fbf9be1a187677e1d6ffa5a7a7a09f 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 DuplicateRecordFields #-} | |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE StrictData #-} | |
{- | |
Something very similar to this works on 8.2.2, I have it in a | |
(non-free) codebase, but can’t quite minimize it… Hmm. | |
It stopped working when I updated that codebase’s compiler to 8.4.3. | |
-} | |
module Main where | |
data AB = A | B | |
class SomeClass (ab :: AB) where | |
data SomeData ab | |
instance SomeClass 'A where | |
data SomeData 'A = SomeData'A{someField :: Int} deriving Show | |
instance SomeClass 'B where | |
data SomeData 'B = SomeData'B{someField :: Int} | |
main :: IO () | |
main = print SomeData'A{someField = 5} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment