@@ -43,17 +43,18 @@ p_dataDecl style name tpats HsDataDefn {..} = do
4343 txt ":: "
4444 located k p_hsType
4545 let gadt = isJust dd_kindSig || any (isGadt . unLoc) dd_cons
46− if gadt
47− then do
48− txt " where"
49− newline
50− inci $ newlineSep (sitcc . located' p_conDecl) dd_cons
51− else switchLayout (combineSrcSpans' (getLoc name :| (getLoc <$> dd_cons))) $ do
52− breakpoint
53− inci $ do
54− txt "= "
55− let sep = vlayout (txt " | ") (txt "| ")
56− velt $ withSep sep (sitcc . located' p_conDecl) dd_cons
46+ unless (null dd_cons) $
47+ if gadt
48+ then do
49+ txt " where"
50+ newline
51+ inci $ newlineSep (sitcc . located' p_conDecl) dd_cons
52+ else switchLayout (combineSrcSpans' (getLoc name :| (getLoc <$> dd_cons))) $
53+ inci $ do
54+ breakpoint
55+ txt "= "
56+ let sep = vlayout (txt " | ") (txt "| ")
57+ velt $ withSep sep (sitcc . located' p_conDecl) dd_cons
5758 newline
5859 inci . located dd_derivs $ \xs ->
5960 forM_ xs (line . located' p_hsDerivingClause)