Created
July 2, 2022 02:21
-
-
Save cdornan/f75cd8024434d998c87610cbb7fb6ab3 to your computer and use it in GitHub Desktop.
Between Haskell2010 and GHC2021
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 DerivingVia #-} | |
module Phantoms where | |
import Data.Typeable | |
class C a where | |
cmethod :: Proxy a -> () | |
class (Show a, Typeable a) => S a where | |
smethod :: a -> Int | |
newtype UsingD a = UsingD { getUsingD :: a } | |
newtype D a = D { getD :: Int } | |
deriving (Show) via UsingD (D a) | |
instance (C a,Typeable a) => S (D a) where smethod = undefined | |
instance (C a,Typeable a) => Show (UsingD a) where showsPrec = undefined | |
instance (C a) => C (D a) where cmethod _ = undefined |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment