@@ -10,6 +10,7 @@ where
12import Ormolu.Printer.Combinators
12import Ormolu.Printer.Combinators
13+import Ormolu.Printer.Meat.Declaration.Class
13import Ormolu.Printer.Meat.Common
14import Ormolu.Printer.Meat.Common
14import Ormolu.Printer.Meat.Declaration.Data
15import Ormolu.Printer.Meat.Declaration.Data
15import Ormolu.Printer.Meat.Declaration.Instance
16import Ormolu.Printer.Meat.Declaration.Instance
@@ -17,6 +18,7 @@ import Ormolu.Printer.Meat.Declaration.Signature
17import Ormolu.Printer.Meat.Declaration.Type
18import Ormolu.Printer.Meat.Declaration.Type
18import Ormolu.Printer.Meat.Declaration.TypeFamily
19import Ormolu.Printer.Meat.Declaration.TypeFamily
19import Ormolu.Printer.Meat.Declaration.Value
20import Ormolu.Printer.Meat.Declaration.Value
21+import Ormolu.Printer.Meat.Type
20import Ormolu.Utils
22import Ormolu.Utils
22p_hsDecl :: HsDecl GhcPs -> R ()
24p_hsDecl :: HsDecl GhcPs -> R ()
@@ -38,32 +40,25 @@ p_hsDecl = \case
39p_tyClDecl :: TyClDecl GhcPs -> R ()
41p_tyClDecl :: TyClDecl GhcPs -> R ()
40p_tyClDecl = \case
42p_tyClDecl = \case
41− FamDecl NoExt x -> p_famDecl x
43+ FamDecl NoExt x -> p_famDecl Free x
42 SynDecl {..} -> p_synDecl tcdLName tcdTyVars tcdRhs
44 SynDecl {..} -> p_synDecl tcdLName tcdTyVars tcdRhs
43 DataDecl {..} ->
45 DataDecl {..} ->
44 p_dataDecl Associated tcdLName (tyVarsToTypes tcdTyVars) tcdDataDefn
46 p_dataDecl Associated tcdLName (tyVarsToTypes tcdTyVars) tcdDataDefn
45− ClassDecl {..} -> notImplemented "ClassDecl"
47+ ClassDecl {..} ->
46− XTyClDecl _ -> notImplemented "XTyClDecl"
57+ XTyClDecl {} -> notImplemented "XTyClDecl"
48p_instDecl :: InstDecl GhcPs -> R ()
59p_instDecl :: InstDecl GhcPs -> R ()
49p_instDecl = \case
60p_instDecl = \case
50 ClsInstD NoExt x -> p_clsInstDecl x
61 ClsInstD NoExt x -> p_clsInstDecl x
51 TyFamInstD NoExt x -> p_tyFamInstDecl Free x
62 TyFamInstD NoExt x -> p_tyFamInstDecl Free x
52 DataFamInstD NoExt x -> p_dataFamInstDecl Free x
63 DataFamInstD NoExt x -> p_dataFamInstDecl Free x
53− XInstDecl _ -> notImplemented "XInstDecl"
64+ _ -> notImplemented "certain kinds of declarations"
55−----------------------------------------------------------------------------
58−tyVarsToTypes :: LHsQTyVars GhcPs -> [LHsType GhcPs]
60− HsQTvs {..} -> fmap tyVarToType <$> hsq_explicit
61− XLHsQTyVars {} -> notImplemented "XLHsQTyVars"
63−tyVarToType :: HsTyVarBndr GhcPs -> HsType GhcPs
65− UserTyVar NoExt tvar -> HsTyVar NoExt NotPromoted tvar
66− KindedTyVar NoExt tvar kind ->
67− HsParTy NoExt $ noLoc $
68− HsKindSig NoExt (noLoc (HsTyVar NoExt NotPromoted tvar)) kind
69− XTyVarBndr {} -> notImplemented "XTyVarBndr"