@@ -49,6 +49,7 @@ data Docs' d = FunDoc (FunDoc' d)
49 | InterfaceDoc Name d -- interface docs
49 | InterfaceDoc Name d -- interface docs
50 [FunDoc' d] -- method docs
50 [FunDoc' d] -- method docs
51 [(Name, Maybe d)] -- parameters and their docstrings
51 [(Name, Maybe d)] -- parameters and their docstrings
52+ [PTerm] -- parameter constraints
52 [(Maybe Name, PTerm, (d, [(Name, d)]))] -- implementations: name for named implementations, the constraint term, the docs
53 [(Maybe Name, PTerm, (d, [(Name, d)]))] -- implementations: name for named implementations, the constraint term, the docs
53 [PTerm] -- sub interfaces
54 [PTerm] -- sub interfaces
54 [PTerm] -- super interfaces
55 [PTerm] -- super interfaces
@@ -140,13 +141,18 @@ pprintDocs ist (DataDoc t args)
140 if null args then text "No constructors."
141 if null args then text "No constructors."
141 else nest 4 (text "Constructors:" <> line <>
142 else nest 4 (text "Constructors:" <> line <>
142 vsep (map (pprintFDWithoutTotality ist False) args))
143 vsep (map (pprintFDWithoutTotality ist False) args))
143−pprintDocs ist (InterfaceDoc n doc meths params implementations sub_interfaces super_interfaces ctor)
144+pprintDocs ist (InterfaceDoc n doc meths params constraints implementations sub_interfaces super_interfaces ctor)
144 = nest 4 (text "Interface" <+> prettyName True (ppopt_impl ppo) [] n <>
145 = nest 4 (text "Interface" <+> prettyName True (ppopt_impl ppo) [] n <>
145 if nullDocstring doc
146 if nullDocstring doc
146 then empty
147 then empty
147 else line <> renderDocstring (renderDocTerm (pprintDelab ist) (normaliseAll (tt_ctxt ist) [])) doc)
148 else line <> renderDocstring (renderDocTerm (pprintDelab ist) (normaliseAll (tt_ctxt ist) [])) doc)
148 <> line <$>
149 <> line <$>
149 nest 4 (text "Parameters:" <$> prettyParameters)
150 nest 4 (text "Parameters:" <$> prettyParameters)
152+ <> (if null constraints
154+ else line <$> nest 4 (text "Constraints:" <$> prettyConstraints))
150 <> line <$>
156 <> line <$>
151 nest 4 (text "Methods:" <$>
157 nest 4 (text "Methods:" <$>
152 vsep (map (pprintFDWithTotality ist False) meths))
158 vsep (map (pprintFDWithTotality ist False) meths))
@@ -233,6 +239,9 @@ pprintDocs ist (InterfaceDoc n doc meths params implementations sub_interfaces s
233 isSubInterface (PPi _ _ _ _ pt) = isSubInterface pt
239 isSubInterface (PPi _ _ _ _ pt) = isSubInterface pt
234 isSubInterface _ = False
240 isSubInterface _ = False
243+ cat (punctuate (comma <> space) (map (pprintPTerm ppo params' [] infixes) constraints))
236 prettyParameters =
245 prettyParameters =
237 if any (isJust . snd) params
246 if any (isJust . snd) params
238 then 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)
@@ -336,7 +345,7 @@ docInterface n ci
336 SN _ -> return Nothing
345 SN _ -> return Nothing
337 _ -> fmap Just $ docFun ctorN
346 _ -> fmap Just $ docFun ctorN
338 return $ InterfaceDoc
347 return $ InterfaceDoc
339− n docstr mdocs params
348+ n docstr mdocs params (interface_constraints ci)
340 implementations' (map (\(_,tm,_) -> tm) sub_interfaces) super_interfaces
349 implementations' (map (\(_,tm,_) -> tm) sub_interfaces) super_interfaces