@@ -8,7 +8,6 @@ module Ormolu.Printer.Meat.Declaration.Type
88 )
99where
1010
11−import Control.Monad
1211import GHC
1312import Ormolu.Printer.Combinators
1413import Ormolu.Printer.Meat.Common
@@ -18,14 +17,18 @@ import SrcLoc (Located)
1817
1918p_synDecl
2019 :: Located RdrName -- ^ Type constructor
20+ -> LexicalFixity -- ^ Fixity
2121 -> LHsQTyVars GhcPs -- ^ Type variables
2222 -> LHsType GhcPs -- ^ RHS of type declaration
2323 -> R ()
24−p_synDecl name tvars t = do
24+p_synDecl name fixity tvars t = do
2525 txt "type "
26− p_rdrName name
2726 let HsQTvs {..} = tvars
28− unless (null hsq_explicit) space
29− sep space (located' p_hsTyVarBndr) hsq_explicit
27+ switchLayout (getLoc name : map getLoc hsq_explicit) $ do
28+ p_infixDefHelper
29+ (case fixity of Infix -> True; _ -> False)
30+ inci
31+ (p_rdrName name)
32+ (map (located' p_hsTyVarBndr) hsq_explicit)
3033 breakpoint
3134 inci (txt "= " >> located t p_hsType)