@@ -8,7 +8,6 @@ module Ormolu.Printer.Meat.Declaration.Type
13import Ormolu.Printer.Combinators
12import Ormolu.Printer.Combinators
14import Ormolu.Printer.Meat.Common
13import Ormolu.Printer.Meat.Common
@@ -18,14 +17,18 @@ import SrcLoc (Located)
20 :: Located RdrName -- ^ Type constructor
19 :: Located RdrName -- ^ Type constructor
20+ -> LexicalFixity -- ^ Fixity
21 -> LHsQTyVars GhcPs -- ^ Type variables
21 -> LHsQTyVars GhcPs -- ^ Type variables
22 -> LHsType GhcPs -- ^ RHS of type declaration
22 -> LHsType GhcPs -- ^ RHS of type declaration
24−p_synDecl name tvars t = do
24+p_synDecl name fixity tvars t = do
25 txt "type "
25 txt "type "
27 let HsQTvs {..} = tvars
26 let HsQTvs {..} = tvars
28− unless (null hsq_explicit) space
27+ switchLayout (getLoc name : map getLoc hsq_explicit) $ do
29+ (case fixity of Infix -> True; _ -> False)
29− sep space (located' p_hsTyVarBndr) hsq_explicit
32+ (map (located' p_hsTyVarBndr) hsq_explicit)
30 breakpoint
33 breakpoint
31 inci (txt "= " >> located t p_hsType)
34 inci (txt "= " >> located t p_hsType)