@@ -148,6 +148,11 @@ pprintDocs ist (InterfaceDoc n doc meths params constraints implementations sub_
148 else line <> renderDocstring (renderDocTerm (pprintDelab ist) (normaliseAll (tt_ctxt ist) [])) doc)
148 else line <> renderDocstring (renderDocTerm (pprintDelab ist) (normaliseAll (tt_ctxt ist) [])) doc)
149 <> line <$>
149 <> line <$>
150 nest 4 (text "Parameters:" <$> prettyParameters)
150 nest 4 (text "Parameters:" <$> prettyParameters)
152+ <> (if null constraints
154+ else line <$> nest 4 (text "Constraints:" <$> prettyConstraints))
151 <> line <$>
156 <> line <$>
152 nest 4 (text "Methods:" <$>
157 nest 4 (text "Methods:" <$>
153 vsep (map (pprintFDWithTotality ist False) meths))
158 vsep (map (pprintFDWithTotality ist False) meths))
@@ -234,17 +239,13 @@ pprintDocs ist (InterfaceDoc n doc meths params constraints implementations sub_
234 isSubInterface (PPi _ _ _ _ pt) = isSubInterface pt
239 isSubInterface (PPi _ _ _ _ pt) = isSubInterface pt
235 isSubInterface _ = False
240 isSubInterface _ = False
237− prettyConstraints separateLine =
242+ prettyConstraints =
238− let separator = if separateLine then line else empty
239− in case constraints of
241− [pt] -> pprintPTerm ppo params' [] infixes pt <+> text "=>" <> separator
242− _ -> parens (cat (punctuate (comma <> space) (map (pprintPTerm ppo params' [] infixes) constraints))) <+> text "=>" <> separator
243+ cat (punctuate (comma <> space) (map (pprintPTerm ppo params' [] infixes) constraints))
244 prettyParameters =
245 prettyParameters =
245 if any (isJust . snd) params
246 if any (isJust . snd) params
246− then prettyConstraints True <> vsep (map (\(nm,md) -> prettyName True False params' nm <+> maybe empty (showDoc ist) md) params)
247+ then vsep (map (\(nm,md) -> prettyName True False params' nm <+> maybe empty (showDoc ist) md) params)
247− else prettyConstraints False <+> hsep (punctuate comma (map (prettyName True False params' . fst) params))
248+ else hsep (punctuate comma (map (prettyName True False params' . fst) params))
249pprintDocs ist (RecordDoc n doc ctor projs params)
250pprintDocs ist (RecordDoc n doc ctor projs params)
250 = nest 4 (text "Record" <+> prettyName True (ppopt_impl ppo) [] n <>
251 = nest 4 (text "Record" <+> prettyName True (ppopt_impl ppo) [] n <>