What does the GHC AST type TyFamInstD
correspond to in TH?
Given,
class X a where
type Z a
instance X A where
type Z A = ... <- this
Thanks!
What does the GHC AST type TyFamInstD
correspond to in TH?
Given,
class X a where
type Z a
instance X A where
type Z A = ... <- this
Thanks!
It looks like TySynInstD
:
Prelude> :set -XTemplateHaskell
Prelude> :set -XTypeFamilies
Prelude> class X a where type R a
Prelude> x = [d| { instance X Int where type R Int = Bool } |]
Prelude> import Language.Haskell.TH.Syntax
Prelude Language.Haskell.TH.Syntax> runQ x
[InstanceD Nothing [] (AppT (ConT Ghci1.X) (ConT GHC.Types.Int)) [TySynInstD (TySynEqn Nothing (AppT (ConT Ghci1.R) (ConT GHC.Types.Int)) (ConT GHC.Types.Bool))]]
Prelude Language.Haskell.TH.Syntax>
Hah. I completely forgot about GHCi! Thanks!